diff --git a/.gitignore b/.gitignore index 8d5a11a054..b96d09da8a 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,15 @@ GTAGS GRTAGS GPATH version.txt + +# Xcode & MacOS +.DS_Store +xcuserdata/ +*.xcodeproj/* +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcworkspace/contents.xcworkspacedata +/*.gcno +ios/Core/ +ios/Carthage/ + diff --git a/CMakeLists.txt b/CMakeLists.txt index 90d3ba1068..fda28148d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ option(AMD_RYZEN_HACK "hack for AMD Ryzen FPU bug (support FMA3 and FMA4 in FPU, if (NOT MSVC) option(STATIC_LINK_RUNTIME "link statically against compiler runtime, standard library and pthreads") endif() -option(NON_PC_TARGET "non-pc target build: iphone, andriod, embedded non-i386 SBC, etc" ) +option(NON_PC_TARGET "non-pc target build: iOS, Android, embedded non-i386 SBC, etc" ) option(SHADOW "use shadow testing framework. linux only" ) option(ASAN "use address sanitiser, if your system has it" ) option(JEMALLOC "use jemalloc. Not required on BSD" ) @@ -70,6 +70,12 @@ if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND SHADOW) message( FATAL_ERROR "shadow-framework is Linux only" ) endif(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND SHADOW) +if(${CMAKE_SYSTEM_NAME} MATCHES "iOS") + message("Compiling for iOS") + add_definitions(-DDarwin) + set(UV_LIB "ios/libuv/libuv-ios-arm64.dylib") +endif(${CMAKE_SYSTEM_NAME} MATCHES "iOS") + if(NOT DEBIAN AND NOT MSVC_VERSION) set(OPTIMIZE_FLAGS -O3) set(DEBUG_FLAGS -O0 -g3) @@ -134,7 +140,7 @@ endif(WOW64_CROSS_COMPILE OR WIN64_CROSS_COMPILE) if(DEBIAN) add_definitions(-DDEBIAN) -elseif(NOT ANDROID AND NOT NON_PC_TARGET) +elseif(NOT ANDROID AND NOT iOS AND NOT NON_PC_TARGET) if (NOT USE_AVX2) # Public binary releases set(CRYPTO_FLAGS -march=nocona -mtune=core2 -mfpmath=sse) @@ -294,7 +300,12 @@ else() add_log_tag(${EXE}) - install(TARGETS ${EXE} RUNTIME DESTINATION bin) + if(APPLE) + install(TARGETS ${EXE} RUNTIME DESTINATION bin BUNDLE DESTINATION bin) + else() + install(TARGETS ${EXE} RUNTIME DESTINATION bin) + endif() + if(WIN32) install(PROGRAMS ${CMAKE_SOURCE_DIR}/lokinet-bootstrap.exe DESTINATION bin) else() diff --git a/abyss-main/Images.xcassets/AppIcon.appiconset/Contents.json b/abyss-main/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..19882d568a --- /dev/null +++ b/abyss-main/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,53 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/abyss-main/Images.xcassets/Contents.json b/abyss-main/Images.xcassets/Contents.json new file mode 100644 index 0000000000..da4a164c91 --- /dev/null +++ b/abyss-main/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/abyss-main/Images.xcassets/LaunchImage.launchimage/Contents.json b/abyss-main/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000000..e37b649490 --- /dev/null +++ b/abyss-main/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "minimum-system-version" : "7.0", + "subtype" : "retina4", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/cmake/unix.cmake b/cmake/unix.cmake index 2467ad8e09..bbe1d214cc 100644 --- a/cmake/unix.cmake +++ b/cmake/unix.cmake @@ -1,6 +1,10 @@ add_definitions(-DUNIX) add_definitions(-DPOSIX) +if(${CMAKE_SYSTEM_NAME} MATCHES "iOS") + link_directories(../ios/libuv/libuv-ios-arm64.dylib) +endif() + if (STATIC_LINK_RUNTIME) find_library(UV_LIB NAMES libuv.a) else() @@ -20,7 +24,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD") elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "DragonFly") find_library(FS_LIB NAMES c++experimental) set(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-unix-freebsd.c ${TT_ROOT}/tuntap-unix-bsd.c) -elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR ${CMAKE_SYSTEM_NAME} MATCHES "iOS") find_library(FS_LIB NAMES c++fs c++experimental stdc++fs) if(FS_LIB STREQUAL FS_LIB-NOTFOUND) diff --git a/crypto/salsa20/xmm6int/salsa20_xmm6int-sse2.c b/crypto/salsa20/xmm6int/salsa20_xmm6int-sse2.c index 5047009523..bfabe14a56 100644 --- a/crypto/salsa20/xmm6int/salsa20_xmm6int-sse2.c +++ b/crypto/salsa20/xmm6int/salsa20_xmm6int-sse2.c @@ -1,6 +1,4 @@ -#if defined(ANDROID) || defined(RPI) - -#else +#if __SSE2__ #include #include #include @@ -120,4 +118,4 @@ struct crypto_stream_salsa20_implementation crypto_stream_salsa20_xmm6int_sse2_implementation = { SODIUM_C99(.stream =) stream_sse2, SODIUM_C99(.stream_xor_ic =) stream_sse2_xor_ic}; -#endif \ No newline at end of file +#endif diff --git a/crypto/salsa20/xmm6int/salsa20_xmm6int-sse2.h b/crypto/salsa20/xmm6int/salsa20_xmm6int-sse2.h index f1f1d6e73f..935e728ec1 100644 --- a/crypto/salsa20/xmm6int/salsa20_xmm6int-sse2.h +++ b/crypto/salsa20/xmm6int/salsa20_xmm6int-sse2.h @@ -3,7 +3,7 @@ #include "../stream_salsa20.h" #include -#ifndef ANDROID +#if __SSE2__ extern struct crypto_stream_salsa20_implementation crypto_stream_salsa20_xmm6int_sse2_implementation; -#endif \ No newline at end of file +#endif diff --git a/daemon/main.cpp b/daemon/main.cpp index 2fce4f6fb0..893f53bbf5 100644 --- a/daemon/main.cpp +++ b/daemon/main.cpp @@ -58,7 +58,7 @@ resolvePath(std::string conffname) { // implemented in netbsd, removed downstream for security reasons // even though it is defined by POSIX.1-2001+ -#if !defined(_WIN32) && !defined(__OpenBSD__) +#if !defined(_WIN32) && !defined(__OpenBSD__) && !defined(iOS) wordexp_t exp_result; wordexp(conffname.c_str(), &exp_result, 0); char *resolvedPath = realpath(exp_result.we_wordv[0], NULL); diff --git a/include/tuntap.h b/include/tuntap.h index 09480a1a7c..e8760f30ca 100644 --- a/include/tuntap.h +++ b/include/tuntap.h @@ -42,6 +42,8 @@ #endif #if defined Linux #include +#elif defined(iOS) +#include #else #include #endif diff --git a/ios/Cartfile b/ios/Cartfile new file mode 100644 index 0000000000..2ab2511991 --- /dev/null +++ b/ios/Cartfile @@ -0,0 +1,2 @@ +github "mutualmobile/MMWormhole" ~> 2.0.0 +github "mxcl/PromiseKit" ~> 6.10.0 diff --git a/ios/Cartfile.resolved b/ios/Cartfile.resolved new file mode 100644 index 0000000000..d1f87da9fb --- /dev/null +++ b/ios/Cartfile.resolved @@ -0,0 +1,2 @@ +github "mutualmobile/MMWormhole" "2.0.10" +github "mxcl/PromiseKit" "6.10.0" diff --git a/ios/LokiNetwork.xcodeproj/project.pbxproj b/ios/LokiNetwork.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..f9bd4a8305 --- /dev/null +++ b/ios/LokiNetwork.xcodeproj/project.pbxproj @@ -0,0 +1,1684 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B833559122D8539900F045AF /* libuv.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B833559022D8539800F045AF /* libuv.1.dylib */; }; + B833559322D853B500F045AF /* libuv.1.dylib in Copy libuv */ = {isa = PBXBuildFile; fileRef = B833559022D8539800F045AF /* libuv.1.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + B8EBA4CB226EA8EB0098F863 /* PacketTunnelProvider.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = B8F79883226056DD00003DE6 /* PacketTunnelProvider.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + B8EBA4CF226EAC620098F863 /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4CE226EAC620098F863 /* NetworkExtension.framework */; }; + B8EBA4D0226EAC7D0098F863 /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4CE226EAC620098F863 /* NetworkExtension.framework */; }; + B8EFF8F422D2F8B3005597E9 /* General.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8EFF8F322D2F8B3005597E9 /* General.swift */; }; + B8EFF92F22D2FEC3005597E9 /* LKDaemon.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8F79878225DBCC500003DE6 /* LKDaemon.swift */; }; + B8EFF93122D2FF8B005597E9 /* lokinet-wrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C3CBFB632256D47400F34631 /* lokinet-wrapper.cpp */; }; + B8EFF93A22D3117D005597E9 /* LKTunnel+Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8EFF93722D30B42005597E9 /* LKTunnel+Configuration.swift */; }; + B8EFF93B22D31180005597E9 /* LKTunnel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8EFF93222D30928005597E9 /* LKTunnel.swift */; }; + B8EFF93C22D3128D005597E9 /* libabyss.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA44E2266B7080098F863 /* libabyss.a */; }; + B8EFF93D22D31293005597E9 /* liblibutp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA45C2266B7080098F863 /* liblibutp.a */; }; + B8EFF93E22D312C9005597E9 /* libabsl_base.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4162266B7080098F863 /* libabsl_base.a */; }; + B8EFF93F22D312D1005597E9 /* libabsl_internal_malloc_internal.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA42A2266B7080098F863 /* libabsl_internal_malloc_internal.a */; }; + B8EFF94022D312DA005597E9 /* libabsl_internal_spinlock_wait.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA42C2266B7080098F863 /* libabsl_internal_spinlock_wait.a */; }; + B8EFF94122D312E0005597E9 /* libabsl_internal_throw_delegate.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA42E2266B7080098F863 /* libabsl_internal_throw_delegate.a */; }; + B8EFF94222D312F4005597E9 /* libabsl_stacktrace.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA43E2266B7080098F863 /* libabsl_stacktrace.a */; }; + B8EFF94322D312FC005597E9 /* libabsl_symbolize.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4442266B7080098F863 /* libabsl_symbolize.a */; }; + B8EFF94422D31303005597E9 /* libabsl_hash.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4202266B7080098F863 /* libabsl_hash.a */; }; + B8EFF94522D31316005597E9 /* libabsl_internal_city.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4242266B7080098F863 /* libabsl_internal_city.a */; }; + B8EFF94622D3131D005597E9 /* libabsl_int128.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4222266B7080098F863 /* libabsl_int128.a */; }; + B8EFF94722D3132B005597E9 /* libabsl_strings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4422266B7080098F863 /* libabsl_strings.a */; }; + B8EFF94822D31333005597E9 /* libabsl_synchronization.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4462266B7080098F863 /* libabsl_synchronization.a */; }; + B8EFF94922D3133B005597E9 /* libabsl_time.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4482266B7080098F863 /* libabsl_time.a */; }; + B8EFF94B22D31354005597E9 /* libabsl_variant.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA44C2266B7080098F863 /* libabsl_variant.a */; }; + B8EFF94C22D31358005597E9 /* libcppbackport.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4522266B7080098F863 /* libcppbackport.a */; }; + B8EFF94D22D31368005597E9 /* libabsl_bad_optional_access.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4142266B7080098F863 /* libabsl_bad_optional_access.a */; }; + B8EFF94E22D3137A005597E9 /* liblokinet-cryptography.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4602266B7080098F863 /* liblokinet-cryptography.a */; }; + B8EFF94F22D31382005597E9 /* liblokinet-util.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4662266B7080098F863 /* liblokinet-util.a */; }; + B8EFF95022D31389005597E9 /* liblokinet-platform.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4622266B7080098F863 /* liblokinet-platform.a */; }; + B8EFF95122D31392005597E9 /* liblokinet-static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4642266B7080098F863 /* liblokinet-static.a */; }; + B8EFF98D22D41544005597E9 /* MMWormhole.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EFF95522D41544005597E9 /* MMWormhole.framework */; }; + B8EFF99122D41768005597E9 /* MMWormhole.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EFF99022D41768005597E9 /* MMWormhole.framework */; }; + B8EFF99622D4262B005597E9 /* NWUDPSessionState+CustomStringConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8EFF99522D4262B005597E9 /* NWUDPSessionState+CustomStringConvertible.swift */; }; + B8EFF99822D429D8005597E9 /* LKMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8EFF99722D429D8005597E9 /* LKMessage.swift */; }; + B8EFF99B22D442AF005597E9 /* LKLokinetManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8EFF99A22D442AF005597E9 /* LKLokinetManager.swift */; }; + B8EFF9D822D445B6005597E9 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EFF9D722D445B6005597E9 /* PromiseKit.framework */; }; + B8EFF9DA22D445C5005597E9 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EFF9D922D445C5005597E9 /* PromiseKit.framework */; }; + B8EFF9DC22D44977005597E9 /* LKMainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B8EFF9DB22D44977005597E9 /* LKMainViewController.xib */; }; + B8EFF9DF22D453B5005597E9 /* LKError.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8EFF99D22D443BB005597E9 /* LKError.swift */; }; + B8EFF9E022D453C1005597E9 /* LKError.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8EFF99D22D443BB005597E9 /* LKError.swift */; }; + B8EFF9E722D5A2C6005597E9 /* General.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8EFF9E622D5A2C6005597E9 /* General.swift */; }; + B8EFF9EE22D5ACDA005597E9 /* GBKUIButtonProgressView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B8EFF9E922D5ACD9005597E9 /* GBKUIButtonProgressView.xib */; }; + B8EFF9EF22D5ACDA005597E9 /* GBKUIButtonProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = B8EFF9EB22D5ACDA005597E9 /* GBKUIButtonProgressView.m */; }; + B8EFF9F022D5ACDA005597E9 /* GBKUIButtonAnimations.m in Sources */ = {isa = PBXBuildFile; fileRef = B8EFF9ED22D5ACDA005597E9 /* GBKUIButtonAnimations.m */; }; + B8EFFA2C22D8201C005597E9 /* libabsl_container.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8EBA4182266B7080098F863 /* libabsl_container.a */; }; + B8F798922260579100003DE6 /* LKPacketTunnelProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8F798912260579100003DE6 /* LKPacketTunnelProvider.swift */; }; + C3FBE36522542DD60006284B /* LKAppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3FBE36422542DD60006284B /* LKAppDelegate.swift */; }; + C3FBE36722542DD60006284B /* LKMainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3FBE36622542DD60006284B /* LKMainViewController.swift */; }; + C3FBE36C22542DD80006284B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3FBE36B22542DD80006284B /* Assets.xcassets */; }; + C3FBE36F22542DD80006284B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C3FBE36D22542DD80006284B /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + B8EBA40F2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 12851CBEF2D340C2826E5C5E; + remoteInfo = absl_any; + }; + B8EBA4112266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 8AB658C39FCA4E7488979671; + remoteInfo = absl_bad_any_cast; + }; + B8EBA4132266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 93485C961493450DACDAF2F3; + remoteInfo = absl_bad_optional_access; + }; + B8EBA4152266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 88EF38228576471C8B124C96; + remoteInfo = absl_base; + }; + B8EBA4172266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 57210768F7F2442B9430E62D; + remoteInfo = absl_container; + }; + B8EBA4192266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 5D2040380F1A484EA924A924; + remoteInfo = absl_demangle_internal; + }; + B8EBA41B2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1D1219D33ACD41BDB23C835B; + remoteInfo = absl_dynamic_annotations; + }; + B8EBA41D2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 79FD5A1A402F418DB503EDD1; + remoteInfo = absl_failure_signal_handler; + }; + B8EBA41F2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 15A3C894450F498BB9A8D95C; + remoteInfo = absl_hash; + }; + B8EBA4212266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C9873AD7A3404EBBA588BD07; + remoteInfo = absl_int128; + }; + B8EBA4232266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 90C0F223925E45ABA409E534; + remoteInfo = absl_internal_city; + }; + B8EBA4252266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 8A01A27F0E204B32AB2D6187; + remoteInfo = absl_internal_debugging_internal; + }; + B8EBA4272266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 798B77A152244451A234B26E; + remoteInfo = absl_internal_examine_stack; + }; + B8EBA4292266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58A6C936749141B0B5EA5037; + remoteInfo = absl_internal_malloc_internal; + }; + B8EBA42B2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 54D601E305E24D959842C2D4; + remoteInfo = absl_internal_spinlock_wait; + }; + B8EBA42D2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 23F11F1A025E44079FF88F97; + remoteInfo = absl_internal_throw_delegate; + }; + B8EBA42F2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 18834323E2414BB49BB1A58B; + remoteInfo = absl_leak_check; + }; + B8EBA4312266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 0FEFF3F1C1564131AEC01699; + remoteInfo = absl_leak_check_disable; + }; + B8EBA4332266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = DDE163271B894CE7ADF822DD; + remoteInfo = absl_meta; + }; + B8EBA4352266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1CC4517E869741EB883A40C4; + remoteInfo = absl_numeric; + }; + B8EBA4372266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 6916424004374968B19EF099; + remoteInfo = absl_optional; + }; + B8EBA4392266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C2755A7CDF244A6BBF0D9B2F; + remoteInfo = absl_raw_hash_set; + }; + B8EBA43B2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 57147AB8BF80445F8491EFDA; + remoteInfo = absl_span; + }; + B8EBA43D2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3E88F57F3CDD4B16B514092E; + remoteInfo = absl_stacktrace; + }; + B8EBA43F2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 0E03286007514DF2B792C29B; + remoteInfo = absl_str_format; + }; + B8EBA4412266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B76C659B2492432CAB4AEF16; + remoteInfo = absl_strings; + }; + B8EBA4432266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = CA55D47B73D046C0B3813EAC; + remoteInfo = absl_symbolize; + }; + B8EBA4452266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 49FD034FFFAD45BBAC6B1919; + remoteInfo = absl_synchronization; + }; + B8EBA4472266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = AF792DDA6EE34EB1800723CC; + remoteInfo = absl_time; + }; + B8EBA4492266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = BE03ACC5E7A4474C92861397; + remoteInfo = absl_utility; + }; + B8EBA44B2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1B2743E2129D43ED96642DEB; + remoteInfo = absl_variant; + }; + B8EBA44D2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 0D0BA81168874C83A18BEF47; + remoteInfo = abyss; + }; + B8EBA44F2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 71DB1AEA43D04EE8A40214A2; + remoteInfo = "abyss-main"; + }; + B8EBA4512266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 750C97A9C73742E6A27D8F48; + remoteInfo = cppbackport; + }; + B8EBA4532266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 15F72EB31F0B4380A3D607CE; + remoteInfo = gmock; + }; + B8EBA4552266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F1ED649448AA4EFF82F9AE05; + remoteInfo = gmock_main; + }; + B8EBA4572266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 5821B30BE5504D90BC3DED67; + remoteInfo = gtest; + }; + B8EBA4592266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 332498756D16440BBE07FF43; + remoteInfo = gtest_main; + }; + B8EBA45B2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 459DEE5B100D4E5F8AE194C8; + remoteInfo = libutp; + }; + B8EBA45D2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3A39D5E565B949978EF8F757; + remoteInfo = lokinet; + }; + B8EBA45F2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = E9083849445D461DB8886B3A; + remoteInfo = "lokinet-cryptography"; + }; + B8EBA4612266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 72B61C292C19447FB024B6B1; + remoteInfo = "lokinet-platform"; + }; + B8EBA4632266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 75F55C18631B45E9A6D96557; + remoteInfo = "lokinet-static"; + }; + B8EBA4652266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D784E18206F2436F83D65662; + remoteInfo = "lokinet-util"; + }; + B8EBA4672266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 21D756BD59784907B7745F4D; + remoteInfo = pow10_helper; + }; + B8EBA4692266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 9A1B77BC544F45D6A7526CA0; + remoteInfo = str_format_extension_internal; + }; + B8EBA46B2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 4CB51089016D4D5B8B844326; + remoteInfo = str_format_internal; + }; + B8EBA46D2266B7080098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B7887DB845E3490489BD6E4F; + remoteInfo = testAll; + }; + B8EBA4C2226EA2DB0098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = FD3EF13792714989A21E998B; + remoteInfo = example; + }; + B8EBA4C4226EA2DB0098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 454893C7E883473A94A17D42; + remoteInfo = link_test; + }; + B8EBA4C6226EA2DB0098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = E66D38919D8242CB934F2898; + remoteInfo = options_test; + }; + B8EBA4C9226EA8E50098F863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3FBE35922542DD60006284B /* Project object */; + proxyType = 1; + remoteGlobalIDString = B8F79882226056DD00003DE6; + remoteInfo = "Packet Tunnel Provider"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + B833559222D8539F00F045AF /* Copy libuv */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + B833559322D853B500F045AF /* libuv.1.dylib in Copy libuv */, + ); + name = "Copy libuv"; + runOnlyForDeploymentPostprocessing = 0; + }; + B8F7988F226056DD00003DE6 /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + B8EBA4CB226EA8EB0098F863 /* PacketTunnelProvider.appex in Embed App Extensions */, + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + B833559022D8539800F045AF /* libuv.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libuv.1.dylib; path = libuv/libuv.1.dylib; sourceTree = SOURCE_ROOT; }; + B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = lokinet.xcodeproj; path = ../Core/lokinet.xcodeproj; sourceTree = ""; }; + B8EBA4CC226EAB5C0098F863 /* PacketTunnelProvider.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = PacketTunnelProvider.entitlements; sourceTree = ""; }; + B8EBA4CD226EAB6B0098F863 /* LokiNetwork.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = LokiNetwork.entitlements; sourceTree = ""; }; + B8EBA4CE226EAC620098F863 /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; }; + B8EBA4D9226EEE080098F863 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; + B8EFF8F322D2F8B3005597E9 /* General.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = General.swift; sourceTree = ""; }; + B8EFF93222D30928005597E9 /* LKTunnel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LKTunnel.swift; sourceTree = ""; }; + B8EFF93722D30B42005597E9 /* LKTunnel+Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LKTunnel+Configuration.swift"; sourceTree = ""; }; + B8EFF95522D41544005597E9 /* MMWormhole.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MMWormhole.framework; path = Carthage/Build/iOS/MMWormhole.framework; sourceTree = SOURCE_ROOT; }; + B8EFF99022D41768005597E9 /* MMWormhole.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MMWormhole.framework; path = Carthage/Build/iOS/MMWormhole.framework; sourceTree = SOURCE_ROOT; }; + B8EFF99522D4262B005597E9 /* NWUDPSessionState+CustomStringConvertible.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NWUDPSessionState+CustomStringConvertible.swift"; sourceTree = ""; }; + B8EFF99722D429D8005597E9 /* LKMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LKMessage.swift; sourceTree = ""; }; + B8EFF99A22D442AF005597E9 /* LKLokinetManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LKLokinetManager.swift; sourceTree = ""; }; + B8EFF99D22D443BB005597E9 /* LKError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LKError.swift; sourceTree = ""; }; + B8EFF9D722D445B6005597E9 /* PromiseKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PromiseKit.framework; path = Carthage/Build/iOS/PromiseKit.framework; sourceTree = SOURCE_ROOT; }; + B8EFF9D922D445C5005597E9 /* PromiseKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PromiseKit.framework; path = Carthage/Build/iOS/PromiseKit.framework; sourceTree = SOURCE_ROOT; }; + B8EFF9DB22D44977005597E9 /* LKMainViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LKMainViewController.xib; sourceTree = ""; }; + B8EFF9E222D59FD9005597E9 /* LokiNetwork-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LokiNetwork-Bridging-Header.h"; sourceTree = ""; }; + B8EFF9E622D5A2C6005597E9 /* General.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = General.swift; sourceTree = ""; }; + B8EFF9E922D5ACD9005597E9 /* GBKUIButtonProgressView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = GBKUIButtonProgressView.xib; sourceTree = ""; }; + B8EFF9EA22D5ACDA005597E9 /* GBKUIButtonAnimations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GBKUIButtonAnimations.h; sourceTree = ""; }; + B8EFF9EB22D5ACDA005597E9 /* GBKUIButtonProgressView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GBKUIButtonProgressView.m; sourceTree = ""; }; + B8EFF9EC22D5ACDA005597E9 /* GBKUIButtonProgressView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GBKUIButtonProgressView.h; sourceTree = ""; }; + B8EFF9ED22D5ACDA005597E9 /* GBKUIButtonAnimations.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GBKUIButtonAnimations.m; sourceTree = ""; }; + B8EFFA2A22D81F0E005597E9 /* libuv-ios-arm64.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libuv-ios-arm64.dylib"; path = "libuv/libuv-ios-arm64.dylib"; sourceTree = ""; }; + B8F797EF225C5E1E00003DE6 /* libcppbackport.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcppbackport.a; path = ../build/vendor/libcppbackport.a; sourceTree = ""; }; + B8F797FB225C641200003DE6 /* liblokinet-platform.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "liblokinet-platform.a"; path = "../build/llarp/liblokinet-platform.a"; sourceTree = ""; }; + B8F797FF225C6D3600003DE6 /* liblokinet-util.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "liblokinet-util.a"; path = "../build/llarp/liblokinet-util.a"; sourceTree = ""; }; + B8F79801225C736E00003DE6 /* libabsl_internal_city.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libabsl_internal_city.a; path = "../build/vendor/abseil-cpp/absl/hash/libabsl_internal_city.a"; sourceTree = ""; }; + B8F79803225C737300003DE6 /* libabsl_hash.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libabsl_hash.a; path = "../build/vendor/abseil-cpp/absl/hash/libabsl_hash.a"; sourceTree = ""; }; + B8F79808225C74A800003DE6 /* libabsl_internal_throw_delegate.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libabsl_internal_throw_delegate.a; path = "../build/vendor/abseil-cpp/absl/base/libabsl_internal_throw_delegate.a"; sourceTree = ""; }; + B8F7980A225C74FA00003DE6 /* libabsl_strings.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libabsl_strings.a; path = "../build/vendor/abseil-cpp/absl/strings/libabsl_strings.a"; sourceTree = ""; }; + B8F79847225DAA0C00003DE6 /* liblibutp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblibutp.a; path = ../build/libutp/liblibutp.a; sourceTree = ""; }; + B8F7984D225DAB7A00003DE6 /* libabyss.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libabyss.a; path = ../build/libabyss.a; sourceTree = ""; }; + B8F79851225DAC4000003DE6 /* liblokinet-cryptography.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "liblokinet-cryptography.a"; path = "../build/crypto/liblokinet-cryptography.a"; sourceTree = ""; }; + B8F79857225DAE1700003DE6 /* libabsl_synchronization.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libabsl_synchronization.a; path = "../build/vendor/abseil-cpp/absl/synchronization/libabsl_synchronization.a"; sourceTree = ""; }; + B8F79859225DAE7100003DE6 /* libabsl_base.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libabsl_base.a; path = "../build/vendor/abseil-cpp/absl/base/libabsl_base.a"; sourceTree = ""; }; + B8F7985B225DAE8B00003DE6 /* libabsl_internal_malloc_internal.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libabsl_internal_malloc_internal.a; path = "../build/vendor/abseil-cpp/absl/base/libabsl_internal_malloc_internal.a"; sourceTree = ""; }; + B8F7985D225DAE9700003DE6 /* libabsl_internal_spinlock_wait.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libabsl_internal_spinlock_wait.a; path = "../build/vendor/abseil-cpp/absl/base/libabsl_internal_spinlock_wait.a"; sourceTree = ""; }; + B8F7985F225DAF4F00003DE6 /* libabsl_time.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libabsl_time.a; path = "../build/vendor/abseil-cpp/absl/time/libabsl_time.a"; sourceTree = ""; }; + B8F79861225DB07800003DE6 /* libabsl_variant.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libabsl_variant.a; path = "../build/vendor/abseil-cpp/absl/types/libabsl_variant.a"; sourceTree = ""; }; + B8F79863225DB0DB00003DE6 /* libabsl_symbolize.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libabsl_symbolize.a; path = "../build/vendor/abseil-cpp/absl/debugging/libabsl_symbolize.a"; sourceTree = ""; }; + B8F79865225DB13E00003DE6 /* libabsl_stacktrace.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libabsl_stacktrace.a; path = "../build/vendor/abseil-cpp/absl/debugging/libabsl_stacktrace.a"; sourceTree = ""; }; + B8F79869225DB19A00003DE6 /* libabsl_bad_optional_access.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libabsl_bad_optional_access.a; path = "../build/vendor/abseil-cpp/absl/types/libabsl_bad_optional_access.a"; sourceTree = ""; }; + B8F7986B225DB1CD00003DE6 /* libabsl_int128.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libabsl_int128.a; path = "../build/vendor/abseil-cpp/absl/numeric/libabsl_int128.a"; sourceTree = ""; }; + B8F79878225DBCC500003DE6 /* LKDaemon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LKDaemon.swift; sourceTree = ""; }; + B8F79883226056DD00003DE6 /* PacketTunnelProvider.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = PacketTunnelProvider.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + B8F79887226056DD00003DE6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B8F798912260579100003DE6 /* LKPacketTunnelProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LKPacketTunnelProvider.swift; sourceTree = ""; }; + C3CBFB632256D47400F34631 /* lokinet-wrapper.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "lokinet-wrapper.cpp"; sourceTree = ""; }; + C3CBFB642256D47400F34631 /* lokinet-wrapper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "lokinet-wrapper.h"; sourceTree = ""; }; + C3CBFB662256D57000F34631 /* liblokinet-static.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "liblokinet-static.a"; path = "../build/llarp/liblokinet-static.a"; sourceTree = ""; }; + C3FBE36122542DD60006284B /* LokiNetwork.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LokiNetwork.app; sourceTree = BUILT_PRODUCTS_DIR; }; + C3FBE36422542DD60006284B /* LKAppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LKAppDelegate.swift; sourceTree = ""; }; + C3FBE36622542DD60006284B /* LKMainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LKMainViewController.swift; sourceTree = ""; }; + C3FBE36B22542DD80006284B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + C3FBE36E22542DD80006284B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + C3FBE37022542DD80006284B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C3FBE37C22543A670006284B /* Packet-Tunnel-Provider-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Packet-Tunnel-Provider-Bridging-Header.h"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B8F79880226056DD00003DE6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B8EFF93D22D31293005597E9 /* liblibutp.a in Frameworks */, + B8EFF93C22D3128D005597E9 /* libabyss.a in Frameworks */, + B8EFF93E22D312C9005597E9 /* libabsl_base.a in Frameworks */, + B8EFFA2C22D8201C005597E9 /* libabsl_container.a in Frameworks */, + B8EFF93F22D312D1005597E9 /* libabsl_internal_malloc_internal.a in Frameworks */, + B8EFF94022D312DA005597E9 /* libabsl_internal_spinlock_wait.a in Frameworks */, + B8EFF94122D312E0005597E9 /* libabsl_internal_throw_delegate.a in Frameworks */, + B8EFF94222D312F4005597E9 /* libabsl_stacktrace.a in Frameworks */, + B8EBA4CF226EAC620098F863 /* NetworkExtension.framework in Frameworks */, + B8EFF94322D312FC005597E9 /* libabsl_symbolize.a in Frameworks */, + B8EFF94422D31303005597E9 /* libabsl_hash.a in Frameworks */, + B8EFF94522D31316005597E9 /* libabsl_internal_city.a in Frameworks */, + B8EFF98D22D41544005597E9 /* MMWormhole.framework in Frameworks */, + B8EFF94622D3131D005597E9 /* libabsl_int128.a in Frameworks */, + B8EFF94722D3132B005597E9 /* libabsl_strings.a in Frameworks */, + B8EFF94822D31333005597E9 /* libabsl_synchronization.a in Frameworks */, + B8EFF9D822D445B6005597E9 /* PromiseKit.framework in Frameworks */, + B8EFF94922D3133B005597E9 /* libabsl_time.a in Frameworks */, + B8EFF94D22D31368005597E9 /* libabsl_bad_optional_access.a in Frameworks */, + B8EFF94B22D31354005597E9 /* libabsl_variant.a in Frameworks */, + B8EFF94C22D31358005597E9 /* libcppbackport.a in Frameworks */, + B8EFF94E22D3137A005597E9 /* liblokinet-cryptography.a in Frameworks */, + B833559122D8539900F045AF /* libuv.1.dylib in Frameworks */, + B8EFF94F22D31382005597E9 /* liblokinet-util.a in Frameworks */, + B8EFF95022D31389005597E9 /* liblokinet-platform.a in Frameworks */, + B8EFF95122D31392005597E9 /* liblokinet-static.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C3FBE35E22542DD60006284B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B8EFF9DA22D445C5005597E9 /* PromiseKit.framework in Frameworks */, + B8EBA4D0226EAC7D0098F863 /* NetworkExtension.framework in Frameworks */, + B8EFF99122D41768005597E9 /* MMWormhole.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + B8EBA3DA2266B7080098F863 /* Products */ = { + isa = PBXGroup; + children = ( + B8EBA4102266B7080098F863 /* libabsl_any.a */, + B8EBA4122266B7080098F863 /* libabsl_bad_any_cast.a */, + B8EBA4142266B7080098F863 /* libabsl_bad_optional_access.a */, + B8EBA4162266B7080098F863 /* libabsl_base.a */, + B8EBA4182266B7080098F863 /* libabsl_container.a */, + B8EBA41A2266B7080098F863 /* libabsl_demangle_internal.a */, + B8EBA41C2266B7080098F863 /* libabsl_dynamic_annotations.a */, + B8EBA41E2266B7080098F863 /* libabsl_failure_signal_handler.a */, + B8EBA4202266B7080098F863 /* libabsl_hash.a */, + B8EBA4222266B7080098F863 /* libabsl_int128.a */, + B8EBA4242266B7080098F863 /* libabsl_internal_city.a */, + B8EBA4262266B7080098F863 /* libabsl_internal_debugging_internal.a */, + B8EBA4282266B7080098F863 /* libabsl_internal_examine_stack.a */, + B8EBA42A2266B7080098F863 /* libabsl_internal_malloc_internal.a */, + B8EBA42C2266B7080098F863 /* libabsl_internal_spinlock_wait.a */, + B8EBA42E2266B7080098F863 /* libabsl_internal_throw_delegate.a */, + B8EBA4302266B7080098F863 /* libabsl_leak_check.a */, + B8EBA4322266B7080098F863 /* libabsl_leak_check_disable.a */, + B8EBA4342266B7080098F863 /* libabsl_meta.a */, + B8EBA4362266B7080098F863 /* libabsl_numeric.a */, + B8EBA4382266B7080098F863 /* libabsl_optional.a */, + B8EBA43A2266B7080098F863 /* libabsl_raw_hash_set.a */, + B8EBA43C2266B7080098F863 /* libabsl_span.a */, + B8EBA43E2266B7080098F863 /* libabsl_stacktrace.a */, + B8EBA4402266B7080098F863 /* libabsl_str_format.a */, + B8EBA4422266B7080098F863 /* libabsl_strings.a */, + B8EBA4442266B7080098F863 /* libabsl_symbolize.a */, + B8EBA4462266B7080098F863 /* libabsl_synchronization.a */, + B8EBA4482266B7080098F863 /* libabsl_time.a */, + B8EBA44A2266B7080098F863 /* libabsl_utility.a */, + B8EBA44C2266B7080098F863 /* libabsl_variant.a */, + B8EBA44E2266B7080098F863 /* libabyss.a */, + B8EBA4502266B7080098F863 /* abyss-main */, + B8EBA4522266B7080098F863 /* libcppbackport.a */, + B8EBA4C3226EA2DB0098F863 /* example */, + B8EBA4542266B7080098F863 /* libgmockd.a */, + B8EBA4562266B7080098F863 /* libgmock_maind.a */, + B8EBA4582266B7080098F863 /* libgtestd.a */, + B8EBA45A2266B7080098F863 /* libgtest_maind.a */, + B8EBA45C2266B7080098F863 /* liblibutp.a */, + B8EBA4C5226EA2DB0098F863 /* link_test */, + B8EBA45E2266B7080098F863 /* lokinet */, + B8EBA4602266B7080098F863 /* liblokinet-cryptography.a */, + B8EBA4622266B7080098F863 /* liblokinet-platform.a */, + B8EBA4642266B7080098F863 /* liblokinet-static.a */, + B8EBA4662266B7080098F863 /* liblokinet-util.a */, + B8EBA4C7226EA2DB0098F863 /* options_test */, + B8EBA4682266B7080098F863 /* libpow10_helper.a */, + B8EBA46A2266B7080098F863 /* libstr_format_extension_internal.a */, + B8EBA46C2266B7080098F863 /* libstr_format_internal.a */, + B8EBA46E2266B7080098F863 /* testAll */, + ); + name = Products; + sourceTree = ""; + }; + B8EBA4D8226EDF4D0098F863 /* UI */ = { + isa = PBXGroup; + children = ( + C3FBE36622542DD60006284B /* LKMainViewController.swift */, + B8EFF9DB22D44977005597E9 /* LKMainViewController.xib */, + ); + name = UI; + sourceTree = ""; + }; + B8EFF8E922D2F682005597E9 /* Core */ = { + isa = PBXGroup; + children = ( + B8F79878225DBCC500003DE6 /* LKDaemon.swift */, + B8EFF99D22D443BB005597E9 /* LKError.swift */, + B8EFF99722D429D8005597E9 /* LKMessage.swift */, + B8F798912260579100003DE6 /* LKPacketTunnelProvider.swift */, + B8EFF93222D30928005597E9 /* LKTunnel.swift */, + B8EFF93722D30B42005597E9 /* LKTunnel+Configuration.swift */, + ); + name = Core; + sourceTree = ""; + }; + B8EFF8EA22D2F689005597E9 /* Utilities */ = { + isa = PBXGroup; + children = ( + B8EFF8F322D2F8B3005597E9 /* General.swift */, + B8EFF99522D4262B005597E9 /* NWUDPSessionState+CustomStringConvertible.swift */, + ); + name = Utilities; + sourceTree = ""; + }; + B8EFF93022D2FF7B005597E9 /* Dependencies */ = { + isa = PBXGroup; + children = ( + C3CBFB642256D47400F34631 /* lokinet-wrapper.h */, + C3CBFB632256D47400F34631 /* lokinet-wrapper.cpp */, + B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */, + B833559022D8539800F045AF /* libuv.1.dylib */, + B8EFF95522D41544005597E9 /* MMWormhole.framework */, + B8EFF9D722D445B6005597E9 /* PromiseKit.framework */, + ); + name = Dependencies; + sourceTree = ""; + }; + B8EFF98F22D4167B005597E9 /* Dependencies */ = { + isa = PBXGroup; + children = ( + B8EFF9E822D5ACC8005597E9 /* GBKUIButtonProgressView */, + B8EFF99022D41768005597E9 /* MMWormhole.framework */, + B8EFF9D922D445C5005597E9 /* PromiseKit.framework */, + ); + name = Dependencies; + sourceTree = ""; + }; + B8EFF99922D4428F005597E9 /* Core */ = { + isa = PBXGroup; + children = ( + B8EFF99A22D442AF005597E9 /* LKLokinetManager.swift */, + ); + name = Core; + sourceTree = ""; + }; + B8EFF9E522D5A2AF005597E9 /* Utilities */ = { + isa = PBXGroup; + children = ( + B8EFF9E622D5A2C6005597E9 /* General.swift */, + ); + name = Utilities; + sourceTree = ""; + }; + B8EFF9E822D5ACC8005597E9 /* GBKUIButtonProgressView */ = { + isa = PBXGroup; + children = ( + B8EFF9EA22D5ACDA005597E9 /* GBKUIButtonAnimations.h */, + B8EFF9ED22D5ACDA005597E9 /* GBKUIButtonAnimations.m */, + B8EFF9EC22D5ACDA005597E9 /* GBKUIButtonProgressView.h */, + B8EFF9EB22D5ACDA005597E9 /* GBKUIButtonProgressView.m */, + B8EFF9E922D5ACD9005597E9 /* GBKUIButtonProgressView.xib */, + ); + path = GBKUIButtonProgressView; + sourceTree = ""; + }; + B8F79874225DB9FF00003DE6 /* Meta */ = { + isa = PBXGroup; + children = ( + C3FBE36B22542DD80006284B /* Assets.xcassets */, + C3FBE37022542DD80006284B /* Info.plist */, + C3FBE36D22542DD80006284B /* LaunchScreen.storyboard */, + C3FBE36422542DD60006284B /* LKAppDelegate.swift */, + B8EBA4CD226EAB6B0098F863 /* LokiNetwork.entitlements */, + B8EFF9E222D59FD9005597E9 /* LokiNetwork-Bridging-Header.h */, + B8EBA4D9226EEE080098F863 /* README.md */, + ); + name = Meta; + sourceTree = ""; + }; + B8F79884226056DD00003DE6 /* PacketTunnelProvider */ = { + isa = PBXGroup; + children = ( + B8EFF93022D2FF7B005597E9 /* Dependencies */, + B8EFF8E922D2F682005597E9 /* Core */, + B8F798902260573500003DE6 /* Meta */, + B8EFF8EA22D2F689005597E9 /* Utilities */, + ); + path = PacketTunnelProvider; + sourceTree = ""; + }; + B8F798902260573500003DE6 /* Meta */ = { + isa = PBXGroup; + children = ( + B8F79887226056DD00003DE6 /* Info.plist */, + C3FBE37C22543A670006284B /* Packet-Tunnel-Provider-Bridging-Header.h */, + B8EBA4CC226EAB5C0098F863 /* PacketTunnelProvider.entitlements */, + ); + name = Meta; + sourceTree = ""; + }; + C3FBE35822542DD60006284B = { + isa = PBXGroup; + children = ( + C3FBE36322542DD60006284B /* LokiNetwork */, + B8F79884226056DD00003DE6 /* PacketTunnelProvider */, + C3FBE36222542DD60006284B /* Products */, + C3FBE376225438E20006284B /* Frameworks */, + ); + sourceTree = ""; + }; + C3FBE36222542DD60006284B /* Products */ = { + isa = PBXGroup; + children = ( + C3FBE36122542DD60006284B /* LokiNetwork.app */, + B8F79883226056DD00003DE6 /* PacketTunnelProvider.appex */, + ); + name = Products; + sourceTree = ""; + }; + C3FBE36322542DD60006284B /* LokiNetwork */ = { + isa = PBXGroup; + children = ( + B8EFF98F22D4167B005597E9 /* Dependencies */, + B8EFF99922D4428F005597E9 /* Core */, + B8EBA4D8226EDF4D0098F863 /* UI */, + B8F79874225DB9FF00003DE6 /* Meta */, + B8EFF9E522D5A2AF005597E9 /* Utilities */, + ); + path = LokiNetwork; + sourceTree = ""; + }; + C3FBE376225438E20006284B /* Frameworks */ = { + isa = PBXGroup; + children = ( + B8EFFA2A22D81F0E005597E9 /* libuv-ios-arm64.dylib */, + B8EBA4CE226EAC620098F863 /* NetworkExtension.framework */, + B8F7984D225DAB7A00003DE6 /* libabyss.a */, + B8F79847225DAA0C00003DE6 /* liblibutp.a */, + B8F79859225DAE7100003DE6 /* libabsl_base.a */, + B8F7985B225DAE8B00003DE6 /* libabsl_internal_malloc_internal.a */, + B8F7985D225DAE9700003DE6 /* libabsl_internal_spinlock_wait.a */, + B8F79808225C74A800003DE6 /* libabsl_internal_throw_delegate.a */, + B8F79865225DB13E00003DE6 /* libabsl_stacktrace.a */, + B8F79863225DB0DB00003DE6 /* libabsl_symbolize.a */, + B8F79803225C737300003DE6 /* libabsl_hash.a */, + B8F79801225C736E00003DE6 /* libabsl_internal_city.a */, + B8F7986B225DB1CD00003DE6 /* libabsl_int128.a */, + B8F7980A225C74FA00003DE6 /* libabsl_strings.a */, + B8F79857225DAE1700003DE6 /* libabsl_synchronization.a */, + B8F7985F225DAF4F00003DE6 /* libabsl_time.a */, + B8F79869225DB19A00003DE6 /* libabsl_bad_optional_access.a */, + B8F79861225DB07800003DE6 /* libabsl_variant.a */, + B8F797EF225C5E1E00003DE6 /* libcppbackport.a */, + B8F79851225DAC4000003DE6 /* liblokinet-cryptography.a */, + B8F797FF225C6D3600003DE6 /* liblokinet-util.a */, + B8F797FB225C641200003DE6 /* liblokinet-platform.a */, + C3CBFB662256D57000F34631 /* liblokinet-static.a */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B8F79882226056DD00003DE6 /* PacketTunnelProvider */ = { + isa = PBXNativeTarget; + buildConfigurationList = B8F7988C226056DD00003DE6 /* Build configuration list for PBXNativeTarget "PacketTunnelProvider" */; + buildPhases = ( + B8F7987F226056DD00003DE6 /* Sources */, + B833559222D8539F00F045AF /* Copy libuv */, + B8F79880226056DD00003DE6 /* Frameworks */, + B8F79881226056DD00003DE6 /* Resources */, + B8EFF98E22D4159F005597E9 /* Copy Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PacketTunnelProvider; + productName = "Packet Tunnel Provider"; + productReference = B8F79883226056DD00003DE6 /* PacketTunnelProvider.appex */; + productType = "com.apple.product-type.app-extension"; + }; + C3FBE36022542DD60006284B /* LokiNetwork */ = { + isa = PBXNativeTarget; + buildConfigurationList = C3FBE37322542DD80006284B /* Build configuration list for PBXNativeTarget "LokiNetwork" */; + buildPhases = ( + C3FBE35D22542DD60006284B /* Sources */, + C3FBE35E22542DD60006284B /* Frameworks */, + C3FBE35F22542DD60006284B /* Resources */, + B8F7988F226056DD00003DE6 /* Embed App Extensions */, + B8EFF99222D41773005597E9 /* Copy Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + B8EBA4CA226EA8E50098F863 /* PBXTargetDependency */, + ); + name = LokiNetwork; + productName = "Loki Network"; + productReference = C3FBE36122542DD60006284B /* LokiNetwork.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + C3FBE35922542DD60006284B /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1020; + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = loki; + TargetAttributes = { + B8F79882226056DD00003DE6 = { + CreatedOnToolsVersion = 10.2; + SystemCapabilities = { + com.apple.ApplicationGroups.iOS = { + enabled = 1; + }; + com.apple.NetworkExtensions.iOS = { + enabled = 1; + }; + com.apple.VPNLite = { + enabled = 1; + }; + }; + }; + C3FBE36022542DD60006284B = { + CreatedOnToolsVersion = 10.2; + LastSwiftMigration = 1020; + SystemCapabilities = { + com.apple.ApplicationGroups.iOS = { + enabled = 1; + }; + com.apple.NetworkExtensions.iOS = { + enabled = 1; + }; + com.apple.VPNLite = { + enabled = 1; + }; + }; + }; + }; + }; + buildConfigurationList = C3FBE35C22542DD60006284B /* Build configuration list for PBXProject "LokiNetwork" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = C3FBE35822542DD60006284B; + productRefGroup = C3FBE36222542DD60006284B /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = B8EBA3DA2266B7080098F863 /* Products */; + ProjectRef = B83E8F062265AC5F00315B9D /* lokinet.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + C3FBE36022542DD60006284B /* LokiNetwork */, + B8F79882226056DD00003DE6 /* PacketTunnelProvider */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + B8EBA4102266B7080098F863 /* libabsl_any.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_any.a; + remoteRef = B8EBA40F2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4122266B7080098F863 /* libabsl_bad_any_cast.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_bad_any_cast.a; + remoteRef = B8EBA4112266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4142266B7080098F863 /* libabsl_bad_optional_access.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_bad_optional_access.a; + remoteRef = B8EBA4132266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4162266B7080098F863 /* libabsl_base.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_base.a; + remoteRef = B8EBA4152266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4182266B7080098F863 /* libabsl_container.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_container.a; + remoteRef = B8EBA4172266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA41A2266B7080098F863 /* libabsl_demangle_internal.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_demangle_internal.a; + remoteRef = B8EBA4192266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA41C2266B7080098F863 /* libabsl_dynamic_annotations.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_dynamic_annotations.a; + remoteRef = B8EBA41B2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA41E2266B7080098F863 /* libabsl_failure_signal_handler.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_failure_signal_handler.a; + remoteRef = B8EBA41D2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4202266B7080098F863 /* libabsl_hash.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_hash.a; + remoteRef = B8EBA41F2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4222266B7080098F863 /* libabsl_int128.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_int128.a; + remoteRef = B8EBA4212266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4242266B7080098F863 /* libabsl_internal_city.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_internal_city.a; + remoteRef = B8EBA4232266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4262266B7080098F863 /* libabsl_internal_debugging_internal.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_internal_debugging_internal.a; + remoteRef = B8EBA4252266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4282266B7080098F863 /* libabsl_internal_examine_stack.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_internal_examine_stack.a; + remoteRef = B8EBA4272266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA42A2266B7080098F863 /* libabsl_internal_malloc_internal.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_internal_malloc_internal.a; + remoteRef = B8EBA4292266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA42C2266B7080098F863 /* libabsl_internal_spinlock_wait.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_internal_spinlock_wait.a; + remoteRef = B8EBA42B2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA42E2266B7080098F863 /* libabsl_internal_throw_delegate.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_internal_throw_delegate.a; + remoteRef = B8EBA42D2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4302266B7080098F863 /* libabsl_leak_check.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_leak_check.a; + remoteRef = B8EBA42F2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4322266B7080098F863 /* libabsl_leak_check_disable.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_leak_check_disable.a; + remoteRef = B8EBA4312266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4342266B7080098F863 /* libabsl_meta.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_meta.a; + remoteRef = B8EBA4332266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4362266B7080098F863 /* libabsl_numeric.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_numeric.a; + remoteRef = B8EBA4352266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4382266B7080098F863 /* libabsl_optional.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_optional.a; + remoteRef = B8EBA4372266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA43A2266B7080098F863 /* libabsl_raw_hash_set.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_raw_hash_set.a; + remoteRef = B8EBA4392266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA43C2266B7080098F863 /* libabsl_span.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_span.a; + remoteRef = B8EBA43B2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA43E2266B7080098F863 /* libabsl_stacktrace.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_stacktrace.a; + remoteRef = B8EBA43D2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4402266B7080098F863 /* libabsl_str_format.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_str_format.a; + remoteRef = B8EBA43F2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4422266B7080098F863 /* libabsl_strings.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_strings.a; + remoteRef = B8EBA4412266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4442266B7080098F863 /* libabsl_symbolize.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_symbolize.a; + remoteRef = B8EBA4432266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4462266B7080098F863 /* libabsl_synchronization.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_synchronization.a; + remoteRef = B8EBA4452266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4482266B7080098F863 /* libabsl_time.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_time.a; + remoteRef = B8EBA4472266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA44A2266B7080098F863 /* libabsl_utility.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_utility.a; + remoteRef = B8EBA4492266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA44C2266B7080098F863 /* libabsl_variant.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabsl_variant.a; + remoteRef = B8EBA44B2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA44E2266B7080098F863 /* libabyss.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libabyss.a; + remoteRef = B8EBA44D2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4502266B7080098F863 /* abyss-main */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + name = "abyss-main"; + path = "abyss-main.app"; + remoteRef = B8EBA44F2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4522266B7080098F863 /* libcppbackport.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libcppbackport.a; + remoteRef = B8EBA4512266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4542266B7080098F863 /* libgmockd.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libgmockd.a; + remoteRef = B8EBA4532266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4562266B7080098F863 /* libgmock_maind.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libgmock_maind.a; + remoteRef = B8EBA4552266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4582266B7080098F863 /* libgtestd.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libgtestd.a; + remoteRef = B8EBA4572266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA45A2266B7080098F863 /* libgtest_maind.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libgtest_maind.a; + remoteRef = B8EBA4592266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA45C2266B7080098F863 /* liblibutp.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = liblibutp.a; + remoteRef = B8EBA45B2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA45E2266B7080098F863 /* lokinet */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + name = lokinet; + path = lokinet.app; + remoteRef = B8EBA45D2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4602266B7080098F863 /* liblokinet-cryptography.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "liblokinet-cryptography.a"; + remoteRef = B8EBA45F2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4622266B7080098F863 /* liblokinet-platform.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "liblokinet-platform.a"; + remoteRef = B8EBA4612266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4642266B7080098F863 /* liblokinet-static.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "liblokinet-static.a"; + remoteRef = B8EBA4632266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4662266B7080098F863 /* liblokinet-util.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "liblokinet-util.a"; + remoteRef = B8EBA4652266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4682266B7080098F863 /* libpow10_helper.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libpow10_helper.a; + remoteRef = B8EBA4672266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA46A2266B7080098F863 /* libstr_format_extension_internal.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libstr_format_extension_internal.a; + remoteRef = B8EBA4692266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA46C2266B7080098F863 /* libstr_format_internal.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libstr_format_internal.a; + remoteRef = B8EBA46B2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA46E2266B7080098F863 /* testAll */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + name = testAll; + path = testAll.app; + remoteRef = B8EBA46D2266B7080098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4C3226EA2DB0098F863 /* example */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + name = example; + path = example.app; + remoteRef = B8EBA4C2226EA2DB0098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4C5226EA2DB0098F863 /* link_test */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + name = link_test; + path = link_test.app; + remoteRef = B8EBA4C4226EA2DB0098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + B8EBA4C7226EA2DB0098F863 /* options_test */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + name = options_test; + path = options_test.app; + remoteRef = B8EBA4C6226EA2DB0098F863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + B8F79881226056DD00003DE6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C3FBE35F22542DD60006284B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C3FBE36F22542DD80006284B /* LaunchScreen.storyboard in Resources */, + B8EFF9DC22D44977005597E9 /* LKMainViewController.xib in Resources */, + B8EFF9EE22D5ACDA005597E9 /* GBKUIButtonProgressView.xib in Resources */, + C3FBE36C22542DD80006284B /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + B8EFF98E22D4159F005597E9 /* Copy Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "$(SRCROOT)/Carthage/Build/iOS/MMWormhole.framework", + "$(SRCROOT)/Carthage/Build/iOS/PromiseKit.framework", + ); + name = "Copy Carthage Frameworks"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/MMWormhole.framework", + "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/PromiseKit.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/usr/local/bin/carthage copy-frameworks\n"; + }; + B8EFF99222D41773005597E9 /* Copy Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "$(SRCROOT)/Carthage/Build/iOS/MMWormhole.framework", + "$(SRCROOT)/Carthage/Build/iOS/PromiseKit.framework", + ); + name = "Copy Carthage Frameworks"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/MMWormhole.framework", + "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/PromiseKit.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/usr/local/bin/carthage copy-frameworks\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B8F7987F226056DD00003DE6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B8EFF99822D429D8005597E9 /* LKMessage.swift in Sources */, + B8F798922260579100003DE6 /* LKPacketTunnelProvider.swift in Sources */, + B8EFF93A22D3117D005597E9 /* LKTunnel+Configuration.swift in Sources */, + B8EFF92F22D2FEC3005597E9 /* LKDaemon.swift in Sources */, + B8EFF93122D2FF8B005597E9 /* lokinet-wrapper.cpp in Sources */, + B8EFF99622D4262B005597E9 /* NWUDPSessionState+CustomStringConvertible.swift in Sources */, + B8EFF8F422D2F8B3005597E9 /* General.swift in Sources */, + B8EFF93B22D31180005597E9 /* LKTunnel.swift in Sources */, + B8EFF9DF22D453B5005597E9 /* LKError.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C3FBE35D22542DD60006284B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B8EFF9E722D5A2C6005597E9 /* General.swift in Sources */, + C3FBE36722542DD60006284B /* LKMainViewController.swift in Sources */, + B8EFF9E022D453C1005597E9 /* LKError.swift in Sources */, + B8EFF99B22D442AF005597E9 /* LKLokinetManager.swift in Sources */, + B8EFF9EF22D5ACDA005597E9 /* GBKUIButtonProgressView.m in Sources */, + C3FBE36522542DD60006284B /* LKAppDelegate.swift in Sources */, + B8EFF9F022D5ACDA005597E9 /* GBKUIButtonAnimations.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + B8EBA4CA226EA8E50098F863 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B8F79882226056DD00003DE6 /* PacketTunnelProvider */; + targetProxy = B8EBA4C9226EA8E50098F863 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + C3FBE36D22542DD80006284B /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + C3FBE36E22542DD80006284B /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B8F7988D226056DD00003DE6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_ENTITLEMENTS = PacketTunnelProvider/PacketTunnelProvider.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 8SQ45X653X; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = "$(SRCROOT)/PacketTunnelProvider/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/libuv", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.niels-andriesse.loki-network.packet-tunnel-provider"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "PacketTunnelProvider/Packet-Tunnel-Provider-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + SYSTEM_HEADER_SEARCH_PATHS = ( + "$(PROJECT_DIR)/../include", + "$(PROJECT_DIR)/../llarp/util", + "$(PROJECT_DIR)/../llarp", + "$(PROJECT_DIR)/../crypto/include", + "$(PROJECT_DIR)/../vendor/abseil-cpp", + "$(PROJECT_DIR)/../vendor/nlohmann/include", + ); + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B8F7988E226056DD00003DE6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_ENTITLEMENTS = PacketTunnelProvider/PacketTunnelProvider.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 8SQ45X653X; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = "$(SRCROOT)/PacketTunnelProvider/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/libuv", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.niels-andriesse.loki-network.packet-tunnel-provider"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "PacketTunnelProvider/Packet-Tunnel-Provider-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + SYSTEM_HEADER_SEARCH_PATHS = ( + "$(PROJECT_DIR)/../include", + "$(PROJECT_DIR)/../llarp/util", + "$(PROJECT_DIR)/../llarp", + "$(PROJECT_DIR)/../crypto/include", + "$(PROJECT_DIR)/../vendor/abseil-cpp", + "$(PROJECT_DIR)/../vendor/nlohmann/include", + ); + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + C3FBE37122542DD80006284B /* 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; + 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 = 12.2; + 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"; + }; + name = Debug; + }; + C3FBE37222542DD80006284B /* 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; + 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 = 12.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C3FBE37422542DD80006284B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = LokiNetwork/LokiNetwork.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 8SQ45X653X; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = "$(SRCROOT)/LokiNetwork/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + OTHER_CFLAGS = "-DDarwin"; + PRODUCT_BUNDLE_IDENTIFIER = "com.niels-andriesse.loki-network"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = "LokiNetwork/LokiNetwork-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + C3FBE37522542DD80006284B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = LokiNetwork/LokiNetwork.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 8SQ45X653X; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = "$(SRCROOT)/LokiNetwork/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + OTHER_CFLAGS = "-DDarwin"; + PRODUCT_BUNDLE_IDENTIFIER = "com.niels-andriesse.loki-network"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = "LokiNetwork/LokiNetwork-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B8F7988C226056DD00003DE6 /* Build configuration list for PBXNativeTarget "PacketTunnelProvider" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B8F7988D226056DD00003DE6 /* Debug */, + B8F7988E226056DD00003DE6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C3FBE35C22542DD60006284B /* Build configuration list for PBXProject "LokiNetwork" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C3FBE37122542DD80006284B /* Debug */, + C3FBE37222542DD80006284B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C3FBE37322542DD80006284B /* Build configuration list for PBXNativeTarget "LokiNetwork" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C3FBE37422542DD80006284B /* Debug */, + C3FBE37522542DD80006284B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = C3FBE35922542DD60006284B /* Project object */; +} diff --git a/ios/LokiNetwork.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/LokiNetwork.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..bd7d08f18b --- /dev/null +++ b/ios/LokiNetwork.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/LokiNetwork.xcodeproj/xcshareddata/xcschemes/Loki Network.xcscheme b/ios/LokiNetwork.xcodeproj/xcshareddata/xcschemes/Loki Network.xcscheme new file mode 100644 index 0000000000..3d560601e0 --- /dev/null +++ b/ios/LokiNetwork.xcodeproj/xcshareddata/xcschemes/Loki Network.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/LokiNetwork.xcodeproj/xcshareddata/xcschemes/Packet Tunnel Provider.xcscheme b/ios/LokiNetwork.xcodeproj/xcshareddata/xcschemes/Packet Tunnel Provider.xcscheme new file mode 100644 index 0000000000..8e5de6c532 --- /dev/null +++ b/ios/LokiNetwork.xcodeproj/xcshareddata/xcschemes/Packet Tunnel Provider.xcscheme @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/LokiNetwork.xcworkspace/contents.xcworkspacedata b/ios/LokiNetwork.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..fd2b091d20 --- /dev/null +++ b/ios/LokiNetwork.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/LokiNetwork/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/LokiNetwork/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..d8db8d65fd --- /dev/null +++ b/ios/LokiNetwork/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/LokiNetwork/Assets.xcassets/Contents.json b/ios/LokiNetwork/Assets.xcassets/Contents.json new file mode 100644 index 0000000000..da4a164c91 --- /dev/null +++ b/ios/LokiNetwork/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/LokiNetwork/Assets.xcassets/ic_control_stop.imageset/Contents.json b/ios/LokiNetwork/Assets.xcassets/ic_control_stop.imageset/Contents.json new file mode 100644 index 0000000000..8388f9965d --- /dev/null +++ b/ios/LokiNetwork/Assets.xcassets/ic_control_stop.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "ic_control_stop.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "ic_control_stop@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "ic_control_stop@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/LokiNetwork/Assets.xcassets/ic_control_stop.imageset/ic_control_stop.png b/ios/LokiNetwork/Assets.xcassets/ic_control_stop.imageset/ic_control_stop.png new file mode 100644 index 0000000000..42f1f7c994 Binary files /dev/null and b/ios/LokiNetwork/Assets.xcassets/ic_control_stop.imageset/ic_control_stop.png differ diff --git a/ios/LokiNetwork/Assets.xcassets/ic_control_stop.imageset/ic_control_stop@2x.png b/ios/LokiNetwork/Assets.xcassets/ic_control_stop.imageset/ic_control_stop@2x.png new file mode 100644 index 0000000000..e4d40d73ea Binary files /dev/null and b/ios/LokiNetwork/Assets.xcassets/ic_control_stop.imageset/ic_control_stop@2x.png differ diff --git a/ios/LokiNetwork/Assets.xcassets/ic_control_stop.imageset/ic_control_stop@3x.png b/ios/LokiNetwork/Assets.xcassets/ic_control_stop.imageset/ic_control_stop@3x.png new file mode 100644 index 0000000000..a88dae9b8d Binary files /dev/null and b/ios/LokiNetwork/Assets.xcassets/ic_control_stop.imageset/ic_control_stop@3x.png differ diff --git a/ios/LokiNetwork/Base.lproj/LaunchScreen.storyboard b/ios/LokiNetwork/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000000..ab480823b2 --- /dev/null +++ b/ios/LokiNetwork/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/LokiNetwork/GBKUIButtonProgressView/GBKUIButtonAnimations.h b/ios/LokiNetwork/GBKUIButtonProgressView/GBKUIButtonAnimations.h new file mode 100755 index 0000000000..4f2e79fe33 --- /dev/null +++ b/ios/LokiNetwork/GBKUIButtonProgressView/GBKUIButtonAnimations.h @@ -0,0 +1,17 @@ +// +// GBKUIButtonAnimations.h +// GBKUIComponentLibraryExample +// +// Created by James Hung on 9/9/15. +// Copyright (c) 2015 James Hung. All rights reserved. +// + +#import +#import + +@interface GBKUIButtonAnimations : NSObject + ++ (void)applyTouchDownAnimationForView:(UIView *)view; ++ (void)applyTouchUpAnimationForView:(UIView *)view; + +@end diff --git a/ios/LokiNetwork/GBKUIButtonProgressView/GBKUIButtonAnimations.m b/ios/LokiNetwork/GBKUIButtonProgressView/GBKUIButtonAnimations.m new file mode 100755 index 0000000000..71e2380f45 --- /dev/null +++ b/ios/LokiNetwork/GBKUIButtonProgressView/GBKUIButtonAnimations.m @@ -0,0 +1,96 @@ +// +// GBKUIButtonAnimations.m +// GBKUIComponentLibraryExample +// +// Created by James Hung on 9/9/15. +// Copyright (c) 2015 James Hung. All rights reserved. +// + +#import "GBKUIButtonAnimations.h" + +static const CGFloat GBKUIButtonAnimationBaseScaleFactor = 0.98; +static const CGFloat GBKUIButtonAnimationAlpha = 0.8; + +@implementation GBKUIButtonAnimations + ++ (CAAnimation *)touchDownAnimationWithXScaleFactor:(CGFloat)xScaleFactor yScaleFactor:(CGFloat)yScaleFactor { + CABasicAnimation *xScaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale.x"]; + xScaleAnimation.fromValue = @1; + xScaleAnimation.toValue = @(xScaleFactor); + xScaleAnimation.duration = 0.15; + + CABasicAnimation *yScaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale.y"]; + yScaleAnimation.fromValue = @1; + yScaleAnimation.toValue = @(yScaleFactor); + yScaleAnimation.duration = 0.15; + + CABasicAnimation *alphaAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; + alphaAnimation.fromValue = @1; + alphaAnimation.toValue = @0.8; + alphaAnimation.duration = 0.15; + + xScaleAnimation.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.34:1.61:0.7:1.0]; + yScaleAnimation.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.34:1.61:0.7:1.0]; + alphaAnimation.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.34:1.61:0.7:1.0]; + + CAAnimationGroup *touchDownAnimation = [[CAAnimationGroup alloc] init]; + touchDownAnimation.animations = @[xScaleAnimation, yScaleAnimation, alphaAnimation]; + touchDownAnimation.duration = 0.15; + return touchDownAnimation; +} + ++ (CAAnimation *)touchUpAnimationWithXScaleFactor:(CGFloat)xScaleFactor yScaleFactor:(CGFloat)yScaleFactor { + CABasicAnimation *xScaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale.x"]; + xScaleAnimation.fromValue = @(xScaleFactor); + xScaleAnimation.toValue = @1; + xScaleAnimation.duration = 0.5; + + CABasicAnimation *yScaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale.y"]; + yScaleAnimation.fromValue = @(yScaleFactor); + yScaleAnimation.toValue = @1; + yScaleAnimation.duration = 0.5; + + CABasicAnimation *alphaAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; + alphaAnimation.fromValue = @0.8; + alphaAnimation.toValue = @1; + alphaAnimation.duration = 0.5; + + xScaleAnimation.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.34:1.61:0.7:1.0]; + yScaleAnimation.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.34:1.61:0.7:1.0]; + alphaAnimation.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.34:1.61:0.7:1.0]; + + CAAnimationGroup *touchUpAnimation = [[CAAnimationGroup alloc] init]; + touchUpAnimation.animations = @[xScaleAnimation, yScaleAnimation, alphaAnimation]; + touchUpAnimation.duration = 0.5; + return touchUpAnimation; +} + ++ (void)applyTouchDownAnimationForView:(UIView *)view { + [view.layer removeAllAnimations]; + + CGFloat xScaleFactor = floorf(GBKUIButtonAnimationBaseScaleFactor * CGRectGetWidth(view.frame))/CGRectGetWidth(view.frame); + + CGFloat yScaleFactor = floorf(GBKUIButtonAnimationBaseScaleFactor * CGRectGetHeight(view.frame))/CGRectGetHeight(view.frame); + + CAAnimation *animation = [self touchDownAnimationWithXScaleFactor:xScaleFactor yScaleFactor:yScaleFactor]; + [view.layer addAnimation:animation forKey:@"GBKUIButtonTouchDownAnimation"]; + view.transform = CGAffineTransformMakeScale(xScaleFactor, yScaleFactor); + view.alpha = GBKUIButtonAnimationAlpha; +} + ++ (void)applyTouchUpAnimationForView:(UIView *)view { + [view.layer removeAllAnimations]; + + CGFloat xScaleFactor = floorf(GBKUIButtonAnimationBaseScaleFactor * CGRectGetWidth(view.frame))/CGRectGetWidth(view.frame); + + CGFloat yScaleFactor = floorf(GBKUIButtonAnimationBaseScaleFactor * CGRectGetHeight(view.frame))/CGRectGetHeight(view.frame); + + CAAnimation *animation = [self touchUpAnimationWithXScaleFactor:xScaleFactor yScaleFactor:yScaleFactor]; + [view.layer addAnimation:animation forKey:@"GBKUIButtonTouchUpAnimation"]; + view.transform = CGAffineTransformMakeScale(1.0, 1.0); + view.alpha = 1.0; +} + + + +@end diff --git a/ios/LokiNetwork/GBKUIButtonProgressView/GBKUIButtonProgressView.h b/ios/LokiNetwork/GBKUIButtonProgressView/GBKUIButtonProgressView.h new file mode 100755 index 0000000000..122edf6d85 --- /dev/null +++ b/ios/LokiNetwork/GBKUIButtonProgressView/GBKUIButtonProgressView.h @@ -0,0 +1,29 @@ +// +// GBKUIProgressButton.h +// Pods +// +// Created by Peter Lada. +// +// + +#import + +@interface GBKUIButtonProgressView : UIView + +@property (strong, nonatomic) NSString *completeTitle; +@property (strong, nonatomic) NSString *initialTitle; +@property (strong, nonatomic) UIFont *font; +@property (assign, nonatomic, getter=isDisabled) BOOL disabled; +@property (assign, nonatomic, readonly) CGFloat progress; +@property (assign, nonatomic, readonly) BOOL isProgressing; +@property (assign, nonatomic, readonly) BOOL isComplete; + +- (void)startProgressing; +- (void)completeProgressing; +- (void)reset; +- (void)setProgress:(CGFloat)progress animated:(BOOL)animated; +- (void)setProgress:(CGFloat)progress animated:(BOOL)animated withCompletion:(void(^)())completion; +- (void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents; + + +@end diff --git a/ios/LokiNetwork/GBKUIButtonProgressView/GBKUIButtonProgressView.m b/ios/LokiNetwork/GBKUIButtonProgressView/GBKUIButtonProgressView.m new file mode 100755 index 0000000000..c6aa64f87c --- /dev/null +++ b/ios/LokiNetwork/GBKUIButtonProgressView/GBKUIButtonProgressView.m @@ -0,0 +1,394 @@ +// +// GBKUIButtonProgress.h +// Pods +// +// Created by Peter Lada +// +// + +#define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI) + +#import "GBKUIButtonProgressView.h" +#import "GBKUIButtonAnimations.h" + +typedef NS_ENUM(NSInteger, GBKUIButtonProgressState) { + GBKUIButtonProgressInitial, + GBKUIButtonProgressShrinking, + GBKUIButtonProgressProgressing, + GBKUIButtonProgressExpandingToComplete, + GBKUIButtonProgressExpandingToInitial, + GBKUIButtonProgressCompleted +}; + +@interface GBKUIButtonProgressView() + +@property (weak, nonatomic) IBOutlet UILabel *titleLabel; +@property (weak, nonatomic) IBOutlet UIView *borderView; +@property (weak, nonatomic) IBOutlet UIButton *button; +@property (weak, nonatomic) IBOutlet UIImageView *pause; + +@property (strong, nonatomic) UIImageView *arcContainer; +@property (strong, nonatomic) CAShapeLayer *arc; + +@property (nonatomic) float expandDuration; + +// initial -> shrinking -> progressing -> expanding -> completed +@property (assign, nonatomic) GBKUIButtonProgressState state; + +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *widthContraint; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *labelLeadingContstraint; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *labelTrailingContstraint; + +@end + +@implementation GBKUIButtonProgressView + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + if (self) { + [self commonInit]; + } + return self; +} + +- (void)awakeFromNib { + [super awakeFromNib]; + [self setupView]; +} + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + self.frame = frame; + [self commonInit]; + [self setupView]; + } + + return self; +} + +- (void)commonInit { + UIView *view = [[[NSBundle bundleForClass:[self class]] loadNibNamed:NSStringFromClass([self class]) owner:self options:nil] firstObject]; + [view setTranslatesAutoresizingMaskIntoConstraints:NO]; + + NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:0]; + NSLayoutConstraint *bottomConstraint = [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; + NSLayoutConstraint *leftConstraint = [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; + NSLayoutConstraint *rightConstraint = [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:0]; + + view.backgroundColor = [UIColor clearColor]; + [self addSubview:view]; + [self addConstraints:@[topConstraint, bottomConstraint, leftConstraint, rightConstraint]]; +} + +- (void)setupView { + self.clipsToBounds = YES; + self.backgroundColor = [UIColor clearColor]; + self.borderView.backgroundColor = [UIColor clearColor]; + self.borderView.layer.borderColor = self.tintColor.CGColor; + self.borderView.layer.cornerRadius = 2.5; + self.borderView.layer.borderWidth = 1; + self.titleLabel.font = [UIFont systemFontOfSize:15.0]; + self.titleLabel.textColor = self.tintColor; + self.pause.tintColor = self.tintColor; + + self.state = GBKUIButtonProgressInitial; + [self setProgress:0 animated:NO]; + self.expandDuration = 0.25; + [self createPauseButton]; +} + +- (void) animateToCircleWithCompletion:(void(^)(BOOL))completion { + float diameter = self.frame.size.height; + self.widthContraint.constant = diameter; + self.widthContraint.priority = 999; + + [UIView animateWithDuration:self.expandDuration + delay:0 + options:UIViewAnimationOptionCurveEaseInOut|UIViewAnimationOptionBeginFromCurrentState + animations:^(void) { + [self layoutIfNeeded]; + self.titleLabel.alpha = 0; + } + completion:^(BOOL finished) { + [self createArcView]; + }]; + + [UIView animateWithDuration:self.expandDuration + delay:self.expandDuration+0.15 + options:UIViewAnimationOptionCurveEaseInOut|UIViewAnimationOptionBeginFromCurrentState + animations:^(void) { + self.pause.alpha = 1; + self.pause.transform = CGAffineTransformMakeScale(1, 1); + } + completion:completion]; + + [self animateCornerRadiusTo:diameter/2]; +} + +- (void) animateCornerRadiusTo:(float)radius { + CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"cornerRadius"]; + animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; + animation.fromValue = [NSNumber numberWithFloat:self.borderView.layer.cornerRadius]; + animation.toValue = [NSNumber numberWithFloat:radius]; + animation.duration = self.expandDuration; + [self.borderView.layer addAnimation:animation forKey:@"cornerRadius"]; + [self.borderView.layer setCornerRadius:radius]; +} + +- (void) animateToButtonWithCompletion:(void(^)())completion { + [UIView animateWithDuration:self.expandDuration + delay:0 + options:UIViewAnimationOptionCurveEaseInOut|UIViewAnimationOptionBeginFromCurrentState + animations:^(void){ + self.arcContainer.alpha = 0; + self.pause.alpha = 0; + self.pause.transform = CGAffineTransformMakeScale(.7, .7); + } + completion:^(BOOL completed) { + [self.arcContainer removeFromSuperview]; + self.arcContainer = nil; + }]; + + self.widthContraint.priority = 1; + [UIView animateWithDuration:self.expandDuration + delay:MAX(self.expandDuration-0.5, 0) + options:UIViewAnimationOptionCurveEaseInOut|UIViewAnimationOptionBeginFromCurrentState + animations:^(void){ + self.titleLabel.alpha = 1; + [self layoutIfNeeded]; + } + completion:^(BOOL completed) { + if(completion) { + completion(); + } + }]; + + [self animateCornerRadiusTo:2.5]; +} + +- (void) createArcView { + self.arcContainer = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.borderView.frame.size.width, self.borderView.frame.size.width)]; + self.arcContainer.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin); + [self.borderView addSubview:self.arcContainer]; + + CGFloat strokeWidth = 3; + CGFloat radius = (self.arcContainer.frame.size.width-strokeWidth) / 2; + // draw arc + self.arc = [CAShapeLayer layer]; + self.arc.frame = CGRectMake(0, 0, radius*2, radius*2); + UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:self.arcContainer.center radius:radius-0.5 startAngle:DEGREES_TO_RADIANS(270) endAngle:DEGREES_TO_RADIANS(269) clockwise:YES]; + self.arc.path = path.CGPath; + self.arc.fillColor = [UIColor clearColor].CGColor; + self.arc.strokeColor = self.tintColor.CGColor; + self.arc.lineWidth = strokeWidth; + + self.arc.strokeStart = 0; + self.arc.strokeEnd = 0; + + [self.arcContainer.layer addSublayer:self.arc]; + +} + +- (void) createPauseButton { + UIImage *pauseImage = [[UIImage imageNamed:@"ic_control_stop"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + self.pause.contentMode = UIViewContentModeCenter; + self.pause.alpha = 0; + self.pause.image = pauseImage; + self.pause.transform = CGAffineTransformMakeScale(.5, .5); +} + +#pragma mark - Public Methods + +- (void) setInitialTitle:(NSString*)title { + if(self.state == GBKUIButtonProgressInitial) { + self.titleLabel.text = title.uppercaseString; + } + _initialTitle = title; +} + +-(void)setCompleteTitle:(NSString *)completeTitle { + if(self.state == GBKUIButtonProgressCompleted) { + self.titleLabel.text = completeTitle.uppercaseString; + } + _completeTitle = completeTitle; +} + +- (void)setFont:(UIFont *)font +{ + self.titleLabel.font = font; +} + +- (UIFont *)font +{ + return self.titleLabel.font; +} + +- (void)setProgress:(CGFloat)progress animated:(BOOL)animated { + [self setProgress:progress animated:animated withCompletion:nil]; +} + +- (void)setProgress:(CGFloat)progress animated:(BOOL)animated withCompletion:(void(^)())completion { + CGFloat previousProgress = _progress; + _progress = progress; + + if(!animated || self.state != GBKUIButtonProgressProgressing) { + if(completion != nil) { + completion(); + } + return; + } + + [CATransaction begin]; + CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; + animation.duration = 0.15; + + if ([[self.arc animationKeys] count] > 0) { + animation.fromValue = @([self.arc.presentationLayer strokeEnd]); + self.arc.strokeEnd = [self.arc.presentationLayer strokeEnd]; + [self.arc removeAllAnimations]; + } else { + animation.fromValue = @(previousProgress); + } + + animation.toValue = @(MAX(progress, 0.05)); + animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; + animation.fillMode = kCAFillModeBoth; // keep to value after finishing + animation.removedOnCompletion = NO; // don't remove after finishing + + [CATransaction setCompletionBlock:completion]; + + [self.arc addAnimation:animation forKey:@"strokeEnd"]; + [CATransaction commit]; +} + +- (void) startProgressing { + if (self.state != GBKUIButtonProgressInitial) { + return; + } + + // shrink animation time + self.state = GBKUIButtonProgressShrinking; + __weak typeof(self) weakSelf = self; + + [self animateToCircleWithCompletion:^(BOOL finished) { + + // if the state was changed, we don't want to do anything + if(self.state != GBKUIButtonProgressShrinking) { + return; + } + // now we're in the expanding state + self.state = GBKUIButtonProgressProgressing; + + // animate the progress from 0 to it's current position + CGFloat currentProgress = weakSelf.progress; + [weakSelf setProgress:0 animated:NO]; + [weakSelf setProgress:currentProgress animated:YES]; + }]; +} + +- (void) completeProgressing { + [self setProgress:1 animated:NO]; + // if the state is initial, the we just change the title and we're complete + if (self.state == GBKUIButtonProgressInitial) { + self.titleLabel.text = self.completeTitle.uppercaseString; + self.state = GBKUIButtonProgressCompleted; + return; + } + + // if the state is currently shrinking, + if(self.state == GBKUIButtonProgressShrinking || self.state == GBKUIButtonProgressProgressing) { + self.titleLabel.text = self.completeTitle.uppercaseString; + self.state = GBKUIButtonProgressExpandingToComplete; + self.disabled = YES; + dispatch_async(dispatch_get_main_queue(), ^{ + [self animateToButtonWithCompletion:^{ + if(self.state == GBKUIButtonProgressExpandingToComplete) { + self.state = GBKUIButtonProgressCompleted; + self.disabled = NO; + } + }]; + }); + return; + } +} + +- (void)reset { + [self setProgress:0 animated:NO]; + if (self.state == GBKUIButtonProgressCompleted) { + self.titleLabel.text = self.initialTitle.uppercaseString; + self.state = GBKUIButtonProgressInitial; + return; + } + + // if the state is currently shrinking, + if(self.state == GBKUIButtonProgressShrinking || self.state == GBKUIButtonProgressProgressing) { + self.titleLabel.text = self.initialTitle.uppercaseString; + self.state = GBKUIButtonProgressExpandingToInitial; + dispatch_async(dispatch_get_main_queue(), ^{ + [self animateToButtonWithCompletion:^{ + if(self.state == GBKUIButtonProgressExpandingToInitial) { + self.state = GBKUIButtonProgressInitial; + } + }]; + }); + return; + } +} + +- (void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents { + [self.button addTarget:target action:action forControlEvents:controlEvents]; +} + +- (void)setDisabled:(BOOL)disabled { + _disabled = disabled; + self.button.enabled = !disabled; + self.alpha = disabled ? 0.45 : 1.0; +} + + +-(void)setState:(GBKUIButtonProgressState)state { + _state = state; + self.button.enabled = !self.disabled || (state != GBKUIButtonProgressExpandingToInitial && state != GBKUIButtonProgressShrinking && state != GBKUIButtonProgressExpandingToComplete); +} + +-(void)setTintColor:(UIColor *)tintColor { + [super setTintColor:tintColor]; + self.borderView.layer.borderColor = tintColor.CGColor; + self.titleLabel.textColor = tintColor; + self.pause.tintColor = tintColor; +} + +-(BOOL)isProgressing { + return self.state == GBKUIButtonProgressProgressing || self.state == GBKUIButtonProgressShrinking; +} + +-(BOOL)isComplete { + return self.state == GBKUIButtonProgressCompleted || self.state == GBKUIButtonProgressExpandingToComplete; +} + +#pragma mark - Event Handling Notifications + +- (IBAction)eventTouchUp:(id)sender { + [self animateTouchUp]; +} + +- (IBAction)eventTouchDown:(id)sender { + [self animateTouchDown]; +} + +- (IBAction)eventTouchDragExit:(id)sender { + [self animateTouchUp]; +} + +#pragma mark - Animation Helper Methods + +- (void)animateTouchUp { + [GBKUIButtonAnimations applyTouchUpAnimationForView:self]; +} + +- (void)animateTouchDown { + [GBKUIButtonAnimations applyTouchDownAnimationForView:self]; +} + +@end diff --git a/ios/LokiNetwork/GBKUIButtonProgressView/GBKUIButtonProgressView.xib b/ios/LokiNetwork/GBKUIButtonProgressView/GBKUIButtonProgressView.xib new file mode 100755 index 0000000000..fe73adcfd8 --- /dev/null +++ b/ios/LokiNetwork/GBKUIButtonProgressView/GBKUIButtonProgressView.xib @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/LokiNetwork/General.swift b/ios/LokiNetwork/General.swift new file mode 100644 index 0000000000..e97ba9b651 --- /dev/null +++ b/ios/LokiNetwork/General.swift @@ -0,0 +1,10 @@ + +extension UIColor { + + convenience init(_ hex: UInt32) { + let red = CGFloat((hex >> 16) & 0xff) / 255 + let green = CGFloat((hex >> 8) & 0xff) / 255 + let blue = CGFloat(hex & 0xff) / 255 + self.init(red: red, green: green, blue: blue, alpha: 255) + } +} diff --git a/ios/LokiNetwork/Info.plist b/ios/LokiNetwork/Info.plist new file mode 100644 index 0000000000..626346b138 --- /dev/null +++ b/ios/LokiNetwork/Info.plist @@ -0,0 +1,44 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Lokinet + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarStyle + UIStatusBarStyleLightContent + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/ios/LokiNetwork/LKAppDelegate.swift b/ios/LokiNetwork/LKAppDelegate.swift new file mode 100644 index 0000000000..f2e39ddc92 --- /dev/null +++ b/ios/LokiNetwork/LKAppDelegate.swift @@ -0,0 +1,18 @@ +import UIKit +import MMWormhole + +@UIApplicationMain +final class LKAppDelegate : UIResponder, UIApplicationDelegate { + var window: UIWindow? + + static let wormhole = MMWormhole(applicationGroupIdentifier: "group.com.niels-andriesse.loki-network", optionalDirectory: nil) + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey:Any]? = nil) -> Bool { + let window = UIWindow(frame: UIScreen.main.bounds) + self.window = window + window.rootViewController = LKMainViewController.load() + window.makeKeyAndVisible() + LKAppDelegate.wormhole.listenForMessage(withIdentifier: "log") { log in print(log ?? "nil") } + return true + } +} diff --git a/ios/LokiNetwork/LKLokinetManager.swift b/ios/LokiNetwork/LKLokinetManager.swift new file mode 100644 index 0000000000..1695d295eb --- /dev/null +++ b/ios/LokiNetwork/LKLokinetManager.swift @@ -0,0 +1,75 @@ +import NetworkExtension +import PromiseKit + +final class LKLokinetManager { + private var tunnelProviderManager: NETunnelProviderManager? + private(set) var status: Status = .disconnected { didSet { onStatusChanged?() } } + var onStatusChanged: (() -> Void)? + + // MARK: Status + enum Status { case connecting, connected, disconnecting, disconnected } + + // MARK: Initialization & Deinitialization + static let shared = LKLokinetManager() + + private init() { + NotificationCenter.default.addObserver(self, selector: #selector(updateStatusIfNeeded), name: .NEVPNStatusDidChange, object: nil) + } + + deinit { + NotificationCenter.default.removeObserver(self) + } + + // MARK: Connection Management + @discardableResult + func start() -> Promise { + return Promise { [weak self] seal in + NETunnelProviderManager.loadAllFromPreferences { tunnelProviderManagers, error in + guard error == nil else { return seal.reject(LKError.loadingTunnelProviderConfigurationFailed) } + func connect(using tunnelProviderManager: NETunnelProviderManager) { + do { + self?.tunnelProviderManager = tunnelProviderManager + try tunnelProviderManager.connection.startVPNTunnel() + seal.fulfill(()) + } catch { + seal.reject(LKError.startingLokinetFailed) + } + } + if let tunnelProviderManager = tunnelProviderManagers?.first { + connect(using: tunnelProviderManager) + } else { + let tunnelProviderManager = NETunnelProviderManager() + let prtcl = NETunnelProviderProtocol() + prtcl.serverAddress = "" // Unused, but the API complains if this isn't set + prtcl.providerBundleIdentifier = "com.niels-andriesse.loki-network.packet-tunnel-provider" + tunnelProviderManager.protocolConfiguration = prtcl + tunnelProviderManager.isEnabled = true + tunnelProviderManager.isOnDemandEnabled = true + tunnelProviderManager.saveToPreferences { error in + guard error == nil else { return seal.reject(LKError.savingTunnelProviderConfigurationFailed) } + tunnelProviderManager.loadFromPreferences { error in + guard error == nil else { return seal.reject(LKError.loadingTunnelProviderConfigurationFailed) } + connect(using: tunnelProviderManager) + } + } + } + } + } + } + + func stop() { + tunnelProviderManager?.connection.stopVPNTunnel() + } + + // MARK: Updating + @objc private func updateStatusIfNeeded() { + guard let status = tunnelProviderManager?.connection.status else { return } + switch status { + case .connecting: self.status = .connecting + case .connected: self.status = .connected + case .disconnecting: self.status = .disconnecting + case .disconnected: self.status = .disconnected + default: break + } + } +} diff --git a/ios/LokiNetwork/LKMainViewController.swift b/ios/LokiNetwork/LKMainViewController.swift new file mode 100644 index 0000000000..8788951343 --- /dev/null +++ b/ios/LokiNetwork/LKMainViewController.swift @@ -0,0 +1,52 @@ +import UIKit + +final class LKMainViewController : UIViewController { + @IBOutlet private var button: GBKUIButtonProgressView! + + private var lokinet: LKLokinetManager { return LKLokinetManager.shared } + + // MARK: Lifecycle + static func load() -> LKMainViewController { + return LKMainViewController(nibName: String(describing: self), bundle: Bundle.main) + } + + override func viewDidLoad() { + super.viewDidLoad() + button.tintColor = UIColor(0x5BCA5B) + button.initialTitle = "Connect" + button.completeTitle = "Disconnect" + button.addTarget(self, action: #selector(toggleLokinet), for: UIControl.Event.touchUpInside) + lokinet.onStatusChanged = { [weak self] in self?.updateButtonStatus() } + LKAppDelegate.wormhole.listenForMessage(withIdentifier: "connection_progress") { [weak self] progress in self?.setButtonProgress(to: progress as! Double) } + } + + // MARK: Updating + private func updateButtonStatus() { + switch lokinet.status { + case .connecting: button.startProgressing() + case .connected: button.completeProgressing() + case .disconnecting, .disconnected: button.reset() + } + } + + private func setButtonProgress(to progress: Double) { + guard button.isProgressing else { return } + button.setProgress(CGFloat(progress), animated: true) + } + + // MARK: Interaction + @objc private func toggleLokinet() { + switch lokinet.status { + case .disconnected: + lokinet.start().catch { error in + if let error = error as? LKError { + print(error.message) + } else { + print("An error occurred.") + } + } + case .connecting, .connected: lokinet.stop() + default: break + } + } +} diff --git a/ios/LokiNetwork/LKMainViewController.xib b/ios/LokiNetwork/LKMainViewController.xib new file mode 100644 index 0000000000..65585243a4 --- /dev/null +++ b/ios/LokiNetwork/LKMainViewController.xib @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/LokiNetwork/LokiNetwork-Bridging-Header.h b/ios/LokiNetwork/LokiNetwork-Bridging-Header.h new file mode 100644 index 0000000000..518f04c3ed --- /dev/null +++ b/ios/LokiNetwork/LokiNetwork-Bridging-Header.h @@ -0,0 +1 @@ +#import "GBKUIButtonProgressView.h" diff --git a/ios/LokiNetwork/LokiNetwork.entitlements b/ios/LokiNetwork/LokiNetwork.entitlements new file mode 100644 index 0000000000..ff67bb8017 --- /dev/null +++ b/ios/LokiNetwork/LokiNetwork.entitlements @@ -0,0 +1,18 @@ + + + + + com.apple.developer.networking.networkextension + + packet-tunnel-provider + + com.apple.developer.networking.vpn.api + + allow-vpn + + com.apple.security.application-groups + + group.com.niels-andriesse.loki-network + + + diff --git a/ios/PacketTunnelProvider/General.swift b/ios/PacketTunnelProvider/General.swift new file mode 100644 index 0000000000..a49300348d --- /dev/null +++ b/ios/PacketTunnelProvider/General.swift @@ -0,0 +1,13 @@ +import MMWormhole + +private let wormhole = MMWormhole(applicationGroupIdentifier: "group.com.niels-andriesse.loki-network", optionalDirectory: nil) + +func LKLog(_ string: String) { + #if DEBUG + wormhole.passMessageObject(string as NSString, identifier: "log") + #endif +} + +func LKUpdateConnectionProgress(_ progress: Double) { + wormhole.passMessageObject(progress as NSNumber, identifier: "connection_progress") +} diff --git a/ios/PacketTunnelProvider/Info.plist b/ios/PacketTunnelProvider/Info.plist new file mode 100644 index 0000000000..5b7990228d --- /dev/null +++ b/ios/PacketTunnelProvider/Info.plist @@ -0,0 +1,31 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + PacketTunnelProvider + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + XPC! + CFBundleShortVersionString + 1.0.0 + CFBundleVersion + 1 + NSExtension + + NSExtensionPointIdentifier + com.apple.networkextension.packet-tunnel + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).LKPacketTunnelProvider + + + diff --git a/ios/PacketTunnelProvider/LKDaemon.swift b/ios/PacketTunnelProvider/LKDaemon.swift new file mode 100644 index 0000000000..4e0a275401 --- /dev/null +++ b/ios/PacketTunnelProvider/LKDaemon.swift @@ -0,0 +1,60 @@ +import Foundation +import PromiseKit + +enum LKDaemon { + + private static let requestTerminationSignal: Int32 = 15 + + struct Configuration { + let isDebuggingEnabled: Bool + let directoryPath: String + let configurationFileName: String + let bootstrapFileURL: URL + let bootstrapFileName: String + } + + typealias Context = OpaquePointer + + static func configure(with configuration: Configuration) -> Promise<(configurationFilePath: String, context: Context)> { + return Promise<(configurationFilePath: String, context: Context)> { seal in + // Enable debugging mode if needed + if configuration.isDebuggingEnabled { llarp_enable_debug_mode() } + // Generate configuration file + let configurationFilePath = configuration.directoryPath + "/" + configuration.configurationFileName + llarp_ensure_config(configurationFilePath, configuration.directoryPath, true, false) + // Update connection progress + LKUpdateConnectionProgress(0.4) + // Download bootstrap file + let downloadTask = URLSession.shared.dataTask(with: configuration.bootstrapFileURL) { data, _, error in + guard let data = data else { return seal.reject(error ?? LKError.downloadingBootstrapFileFailed) } + let bootstrapFilePath = configuration.directoryPath + "/" + configuration.bootstrapFileName + do { + try data.write(to: URL(fileURLWithPath: bootstrapFilePath)) + } catch let error { + return seal.reject(error) + } + // Update connection progress + LKUpdateConnectionProgress(0.6) + // Perform main setup + guard let context = llarp_main_init(configurationFilePath, false) else { return seal.reject(LKError.llarpInitializationFailed) } + llarp_main_setup(context, configuration.isDebuggingEnabled) + // Update connection progress + LKUpdateConnectionProgress(0.8) + // Invoke completion handler + seal.fulfill((configurationFilePath: configurationFilePath, context: context)) + } + downloadTask.resume() + } + } + + static func start(with context: Context) -> Bool { + let resultCode = llarp_main_run(context) + let isSuccess = (resultCode == 0) + if isSuccess { LKUpdateConnectionProgress(1.0) } + return isSuccess + } + + static func stop(with context: Context) { + llarp_main_signal(context, requestTerminationSignal) + } +} diff --git a/ios/PacketTunnelProvider/LKError.swift b/ios/PacketTunnelProvider/LKError.swift new file mode 100644 index 0000000000..8564b02283 --- /dev/null +++ b/ios/PacketTunnelProvider/LKError.swift @@ -0,0 +1,22 @@ + +enum LKError : Error { + case loadingTunnelProviderConfigurationFailed + case savingTunnelProviderConfigurationFailed + case startingLokinetFailed + case downloadingBootstrapFileFailed + case llarpInitializationFailed + case openingTunnelFailed(destination: String) + case startingDaemonFailed + + var message: String { + switch self { + case .loadingTunnelProviderConfigurationFailed: return "Couldn't load tunnel provider configuration" + case .savingTunnelProviderConfigurationFailed: return "Couldn't save tunnel provider configuration" + case .startingLokinetFailed: return "Couldn't start Lokinet" + case .downloadingBootstrapFileFailed: return "Couldn't download bootstrap file" + case .llarpInitializationFailed: return "Couldn't initialize LLARP" + case .openingTunnelFailed(let destination): return "Couldn't open tunnel to \(destination)" + case .startingDaemonFailed: return "Couldn't start daemon" + } + } +} diff --git a/ios/PacketTunnelProvider/LKMessage.swift b/ios/PacketTunnelProvider/LKMessage.swift new file mode 100644 index 0000000000..c3ea6915f2 --- /dev/null +++ b/ios/PacketTunnelProvider/LKMessage.swift @@ -0,0 +1,13 @@ +import Foundation + +struct LKMessage { + private let headerSizeInBytes = 2 + + enum Kind : String { + case requestSession, acceptSession, rejectSession + } + + init(from data: Data) { + let payloadAsData = data[headerSizeInBytes...data.endIndex] + } +} diff --git a/ios/PacketTunnelProvider/LKPacketTunnelProvider.swift b/ios/PacketTunnelProvider/LKPacketTunnelProvider.swift new file mode 100644 index 0000000000..7ba5afbb62 --- /dev/null +++ b/ios/PacketTunnelProvider/LKPacketTunnelProvider.swift @@ -0,0 +1,39 @@ +import Foundation +import NetworkExtension + +/// The general idea here is to intercept packets, pass them to the Lokinet core so that it can modify them as described by the LLARP Traffic Routing Protocol, and then pass them to the appropriate snode(s). +final class LKPacketTunnelProvider : NEPacketTunnelProvider { + private var daemonContext: LKDaemon.Context? + + override func startTunnel(options: [String:NSObject]? = nil, completionHandler: @escaping (Error?) -> Void) { + let directoryPath = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.niels-andriesse.loki-network")!.path + let configurationFileName = "lokinet-configuration.ini" + let bootstrapFileURL = URL(string: "https://i2p.rocks/i2procks.signed")! + let bootstrapFileName = "bootstrap.signed" + let daemonConfiguration = LKDaemon.Configuration(isDebuggingEnabled: false, directoryPath: directoryPath, configurationFileName: configurationFileName, bootstrapFileURL: bootstrapFileURL, bootstrapFileName: bootstrapFileName) + LKUpdateConnectionProgress(0.2) + LKDaemon.configure(with: daemonConfiguration).done { [weak self] _, context in + let isSuccess = LKDaemon.start(with: context) + if isSuccess { + self?.daemonContext = context + completionHandler(nil) + } else { + let error = LKError.startingDaemonFailed + LKLog(error.message) + completionHandler(error) + } + }.catch { error in + if let error = error as? LKError { + LKLog(error.message) + } else { + LKLog("An error occurred.") + } + completionHandler(error) + } + } + + override func stopTunnel(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) { + if let context = daemonContext { LKDaemon.stop(with: context) } + completionHandler() + } +} diff --git a/ios/PacketTunnelProvider/LKTunnel+Configuration.swift b/ios/PacketTunnelProvider/LKTunnel+Configuration.swift new file mode 100644 index 0000000000..abf9cc544f --- /dev/null +++ b/ios/PacketTunnelProvider/LKTunnel+Configuration.swift @@ -0,0 +1,13 @@ + +extension LKTunnel { + + struct Configuration { + let address: String + let port: UInt16 + + init(address: String, port: UInt16) { + self.address = address + self.port = port + } + } +} diff --git a/ios/PacketTunnelProvider/LKTunnel.swift b/ios/PacketTunnelProvider/LKTunnel.swift new file mode 100644 index 0000000000..9dbcad5252 --- /dev/null +++ b/ios/PacketTunnelProvider/LKTunnel.swift @@ -0,0 +1,62 @@ +import NetworkExtension +import PromiseKit + +/// A UDP based tunnel used for snode communication. +final class LKTunnel : NSObject { + private let provider: NEPacketTunnelProvider + private let configuration: Configuration + private var session: NWUDPSession? + private var openSeal: PromiseKit.Resolver? + + // MARK: Initialization + init(provider: NEPacketTunnelProvider, configuration: Configuration) { + self.provider = provider + self.configuration = configuration + } + + // MARK: Connection + func open() -> Promise { + let tuple = Promise.pending() + openSeal = tuple.resolver + let endpoint = NWHostEndpoint(hostname: configuration.address, port: String(configuration.port)) + session = provider.createUDPSession(to: endpoint, from: nil) + LKLog("Tunnel (to \(configuration.address):\(configuration.port) state changed to preparing.") + session!.addObserver(self, forKeyPath: "state", options: .initial, context: &session) + session!.setReadHandler(read(_:_:), maxDatagrams: Int.max) + return tuple.promise + } + + override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey:Any]?, context: UnsafeMutableRawPointer?) { + if keyPath == "state" && context?.assumingMemoryBound(to: Optional.self).pointee == session { + let state = session!.state + LKLog("Tunnel (to \(configuration.address):\(configuration.port) state changed to \(state).") + switch state { + case .ready: + openSeal!.fulfill(()) + openSeal = nil + case .failed, .cancelled: close() + default: break + } + } else { + super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context) + } + } + + private func read(_ datagrams: [Data]?, _ error: Error?) { + if let datagrams = datagrams { + LKLog("Read datagrams: \(datagrams).") + } else if let error = error { + LKLog("Couldn't read datagrams due to error: \(error).") + } else { + LKLog("Couldn't read datagrams.") + } + } + + func close() { + session?.cancel() + openSeal?.reject(LKError.openingTunnelFailed(destination: "\(configuration.address):\(configuration.port)")) + openSeal = nil + session?.removeObserver(self, forKeyPath: "state") + session = nil + } +} diff --git a/ios/PacketTunnelProvider/NWUDPSessionState+CustomStringConvertible.swift b/ios/PacketTunnelProvider/NWUDPSessionState+CustomStringConvertible.swift new file mode 100644 index 0000000000..a276b78047 --- /dev/null +++ b/ios/PacketTunnelProvider/NWUDPSessionState+CustomStringConvertible.swift @@ -0,0 +1,16 @@ +import NetworkExtension + +extension NWUDPSessionState : CustomStringConvertible { + + public var description: String { + switch self { + case .invalid: return "invalid" + case .waiting: return "waiting" + case .preparing: return "preparing" + case .ready: return "ready" + case .failed: return "failed" + case .cancelled: return "cancelled" + default: return "unknown" + } + } +} diff --git a/ios/PacketTunnelProvider/Packet-Tunnel-Provider-Bridging-Header.h b/ios/PacketTunnelProvider/Packet-Tunnel-Provider-Bridging-Header.h new file mode 100644 index 0000000000..a2c07b6365 --- /dev/null +++ b/ios/PacketTunnelProvider/Packet-Tunnel-Provider-Bridging-Header.h @@ -0,0 +1,3 @@ +#import "stdbool.h" +#import "llarp.h" +#import "lokinet-wrapper.h" diff --git a/ios/PacketTunnelProvider/PacketTunnelProvider.entitlements b/ios/PacketTunnelProvider/PacketTunnelProvider.entitlements new file mode 100644 index 0000000000..ff67bb8017 --- /dev/null +++ b/ios/PacketTunnelProvider/PacketTunnelProvider.entitlements @@ -0,0 +1,18 @@ + + + + + com.apple.developer.networking.networkextension + + packet-tunnel-provider + + com.apple.developer.networking.vpn.api + + allow-vpn + + com.apple.security.application-groups + + group.com.niels-andriesse.loki-network + + + diff --git a/ios/PacketTunnelProvider/lokinet-wrapper.cpp b/ios/PacketTunnelProvider/lokinet-wrapper.cpp new file mode 100644 index 0000000000..cc36036eb5 --- /dev/null +++ b/ios/PacketTunnelProvider/lokinet-wrapper.cpp @@ -0,0 +1,7 @@ +#include "logger.hpp" + +extern "C" +void +llarp_enable_debug_mode() { + llarp::SetLogLevel(llarp::eLogDebug); +} diff --git a/ios/PacketTunnelProvider/lokinet-wrapper.h b/ios/PacketTunnelProvider/lokinet-wrapper.h new file mode 100644 index 0000000000..f4f644f35d --- /dev/null +++ b/ios/PacketTunnelProvider/lokinet-wrapper.h @@ -0,0 +1,3 @@ + +void +llarp_enable_debug_mode(); diff --git a/ios/README.md b/ios/README.md new file mode 100644 index 0000000000..53a770f1e8 --- /dev/null +++ b/ios/README.md @@ -0,0 +1,10 @@ +To compile Lokinet for iOS, execute the following from the Lokinet root folder: + +``` +cmake -G Xcode -DCMAKE_TOOLCHAIN_FILE=ios/ios.cmake -DDEPLOYMENT_TARGET=10.0 -B ios/Core -S . +cmake --build ios/Core --config Debug --target lokinet +``` + +You can safely ignore the code signing warning that's emitted. + +If you run into issues with libuv not being found, install it by running `brew install libuv` and/or add `include_directories(/usr/local/include)` to cmake/unix.cmake. diff --git a/ios/ios.cmake b/ios/ios.cmake new file mode 100644 index 0000000000..462b0c6d6b --- /dev/null +++ b/ios/ios.cmake @@ -0,0 +1,660 @@ +# This file is part of the ios-cmake project. It was retrieved from +# https://github.com/cristeab/ios-cmake.git, which is a fork of +# https://code.google.com/p/ios-cmake/. Which in turn is based off of +# the Platform/Darwin.cmake and Platform/UnixPaths.cmake files which +# are included with CMake 2.8.4 +# +# The ios-cmake project is licensed under the new BSD license. +# +# Copyright (c) 2014, Bogdan Cristea and LTE Engineering Software, +# Kitware, Inc., Insight Software Consortium. All rights reserved. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# This file is based off of the Platform/Darwin.cmake and +# Platform/UnixPaths.cmake files which are included with CMake 2.8.4 +# It has been altered for iOS development. +# +# Updated by Alex Stewart (alexs.mac@gmail.com) +# +# ***************************************************************************** +# Now maintained by Alexander Widerberg (widerbergaren [at] gmail.com) +# under the BSD-3-Clause license +# https://github.com/leetal/ios-cmake +# ***************************************************************************** +# +# INFORMATION / HELP +# +# The following arguments control the behaviour of this toolchain: +# +# PLATFORM: (default "OS") +# OS = Build for iPhoneOS. +# OS64 = Build for arm64 iphoneOS. +# OS64COMBINED = Build for arm64 x86_64 iphoneOS. Combined into FAT STATIC lib (supported on 3.14+ of CMakewith "-G Xcode" argument ONLY) +# SIMULATOR = Build for x86 i386 iphoneOS Simulator. +# SIMULATOR64 = Build for x86_64 iphoneOS Simulator. +# TVOS = Build for arm64 tvOS. +# TVOSCOMBINED = Build for arm64 x86_64 tvOS. Combined into FAT STATIC lib (supported on 3.14+ of CMake with "-G Xcode" argument ONLY) +# SIMULATOR_TVOS = Build for x86_64 tvOS Simulator. +# WATCHOS = Build for armv7k arm64_32 for watchOS. +# WATCHOSCOMBINED = Build for armv7k arm64_32 x86_64 watchOS. Combined into FAT STATIC lib (supported on 3.14+ of CMake with "-G Xcode" argument ONLY) +# SIMULATOR_WATCHOS = Build for x86_64 for watchOS Simulator. +# +# CMAKE_OSX_SYSROOT: Path to the SDK to use. By default this is +# automatically determined from PLATFORM and xcodebuild, but +# can also be manually specified (although this should not be required). +# +# CMAKE_DEVELOPER_ROOT: Path to the Developer directory for the platform +# being compiled for. By default this is automatically determined from +# CMAKE_OSX_SYSROOT, but can also be manually specified (although this should +# not be required). +# +# DEPLOYMENT_TARGET: Minimum SDK version to target. Default 2.0 on watchOS and 9.0 on tvOS+iOS +# +# ENABLE_BITCODE: (1|0) Enables or disables bitcode support. Default 1 (true) +# +# ENABLE_ARC: (1|0) Enables or disables ARC support. Default 1 (true, ARC enabled by default) +# +# ENABLE_VISIBILITY: (1|0) Enables or disables symbol visibility support. Default 0 (false, visibility hidden by default) +# +# ARCHS: (armv7 armv7s armv7k arm64 arm64_32 i386 x86_64) If specified, will override the default architectures for the given PLATFORM +# OS = armv7 armv7s arm64 (if applicable) +# OS64 = arm64 (if applicable) +# SIMULATOR = i386 +# SIMULATOR64 = x86_64 +# TVOS = arm64 +# SIMULATOR_TVOS = x86_64 (i386 has since long been deprecated) +# WATCHOS = armv7k arm64_32 (if applicable) +# SIMULATOR_WATCHOS = x86_64 (i386 has since long been deprecated) +# +# This toolchain defines the following variables for use externally: +# +# XCODE_VERSION: Version number (not including Build version) of Xcode detected. +# SDK_VERSION: Version of SDK being used. +# CMAKE_OSX_ARCHITECTURES: Architectures being compiled for (generated from PLATFORM). +# +# This toolchain defines the following macros for use externally: +# +# set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE XCODE_VARIANT) +# A convenience macro for setting xcode specific properties on targets. +# Available variants are: All, Release, RelWithDebInfo, Debug, MinSizeRel +# example: set_xcode_property (myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1" "all"). +# +# find_host_package (PROGRAM ARGS) +# A macro used to find executable programs on the host system, not within the +# environment. Thanks to the android-cmake project for providing the +# command. +# +# ******************************** DEPRECATIONS ******************************* +# +# IOS_DEPLOYMENT_TARGET: (Deprecated) Alias to DEPLOYMENT_TARGET +# CMAKE_IOS_DEVELOPER_ROOT: (Deprecated) Alias to CMAKE_DEVELOPER_ROOT +# IOS_PLATFORM: (Deprecated) Alias to PLATFORM +# IOS_ARCH: (Deprecated) Alias to ARCHS +# +# ***************************************************************************** +# + +# Fix for PThread library not in path +set(CMAKE_THREAD_LIBS_INIT "-lpthread") +set(CMAKE_HAVE_THREADS_LIBRARY 1) +set(CMAKE_USE_WIN32_THREADS_INIT 0) +set(CMAKE_USE_PTHREADS_INIT 1) + +# Cache what generator is used +set(USED_CMAKE_GENERATOR "${CMAKE_GENERATOR}" CACHE STRING "Expose CMAKE_GENERATOR" FORCE) + +if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14") + set(MODERN_CMAKE YES) + message(STATUS "Merging integrated CMake 3.14+ iOS,tvOS,watchOS,macOS toolchain(s) with this toolchain!") +endif() + +# Get the Xcode version being used. +execute_process(COMMAND xcodebuild -version + OUTPUT_VARIABLE XCODE_VERSION + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) +string(REGEX MATCH "Xcode [0-9\\.]+" XCODE_VERSION "${XCODE_VERSION}") +string(REGEX REPLACE "Xcode ([0-9\\.]+)" "\\1" XCODE_VERSION "${XCODE_VERSION}") +message(STATUS "Building with Xcode version: ${XCODE_VERSION}") + +######## ALIASES (DEPRECATION WARNINGS) + +if(DEFINED IOS_PLATFORM) + set(PLATFORM ${IOS_PLATFORM}) + message(DEPRECATION "IOS_PLATFORM argument is DEPRECATED. Consider using the new PLATFORM argument instead.") +endif() + +if(DEFINED IOS_DEPLOYMENT_TARGET) + set(DEPLOYMENT_TARGET ${IOS_DEPLOYMENT_TARGET}) + message(DEPRECATION "IOS_DEPLOYMENT_TARGET argument is DEPRECATED. Consider using the new DEPLOYMENT_TARGET argument instead.") +endif() + +if(DEFINED CMAKE_IOS_DEVELOPER_ROOT) + set(CMAKE_DEVELOPER_ROOT ${CMAKE_IOS_DEVELOPER_ROOT}) + message(DEPRECATION "CMAKE_IOS_DEVELOPER_ROOT argument is DEPRECATED. Consider using the new CMAKE_DEVELOPER_ROOT argument instead.") +endif() + +if(DEFINED IOS_ARCH) + set(ARCHS ${IOS_ARCH}) + message(DEPRECATION "IOS_ARCH argument is DEPRECATED. Consider using the new ARCHS argument instead.") +endif() + +######## END ALIASES + +# Unset the FORCE on cache variables if in try_compile() +set(FORCE_CACHE FORCE) +get_property(_CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE) +if(_CMAKE_IN_TRY_COMPILE) + unset(FORCE_CACHE) +endif() + +# Default to building for iPhoneOS if not specified otherwise, and we cannot +# determine the platform from the CMAKE_OSX_ARCHITECTURES variable. The use +# of CMAKE_OSX_ARCHITECTURES is such that try_compile() projects can correctly +# determine the value of PLATFORM from the root project, as +# CMAKE_OSX_ARCHITECTURES is propagated to them by CMake. +if(NOT DEFINED PLATFORM) + if (CMAKE_OSX_ARCHITECTURES) + if(CMAKE_OSX_ARCHITECTURES MATCHES ".*arm.*" AND CMAKE_OSX_SYSROOT MATCHES ".*iphoneos.*") + set(PLATFORM "OS") + elseif(CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_SYSROOT MATCHES ".*iphonesimulator.*") + set(PLATFORM "SIMULATOR") + elseif(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" AND CMAKE_OSX_SYSROOT MATCHES ".*iphonesimulator.*") + set(PLATFORM "SIMULATOR64") + elseif(CMAKE_OSX_ARCHITECTURES MATCHES "arm64" AND CMAKE_OSX_SYSROOT MATCHES ".*appletvos.*") + set(PLATFORM "TVOS") + elseif(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" AND CMAKE_OSX_SYSROOT MATCHES ".*appletvsimulator.*") + set(PLATFORM "SIMULATOR_TVOS") + elseif(CMAKE_OSX_ARCHITECTURES MATCHES ".*armv7k.*" AND CMAKE_OSX_SYSROOT MATCHES ".*watchos.*") + set(PLATFORM "WATCHOS") + elseif(CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_SYSROOT MATCHES ".*watchsimulator.*") + set(PLATFORM "SIMULATOR_WATCHOS") + endif() + endif() + if (NOT PLATFORM) + set(PLATFORM "OS") + endif() +endif() + +set(PLATFORM_INT "${PLATFORM}" CACHE STRING "Type of platform for which the build targets.") + +# Handle the case where we are targeting iOS and a version above 10.0 (32-bit support dropped officially) +if(PLATFORM_INT STREQUAL "OS" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.0) + set(PLATFORM_INT "OS64") + message(STATUS "Targeting minimum SDK version ${DEPLOYMENT_TARGET}. Dropping 32-bit support.") +elseif(PLATFORM_INT STREQUAL "SIMULATOR" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.0) + set(PLATFORM_INT "SIMULATOR64") + message(STATUS "Targeting minimum SDK version ${DEPLOYMENT_TARGET}. Dropping 32-bit support.") +endif() + +# Determine the platform name and architectures for use in xcodebuild commands +# from the specified PLATFORM name. +if(PLATFORM_INT STREQUAL "OS") + set(SDK_NAME iphoneos) + if(NOT ARCHS) + set(ARCHS armv7 armv7s arm64) + endif() +elseif(PLATFORM_INT STREQUAL "OS64") + set(SDK_NAME iphoneos) + if(NOT ARCHS) + if (XCODE_VERSION VERSION_GREATER 10.0) + set(ARCHS arm64) # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example + else() + set(ARCHS arm64) + endif() + endif() +elseif(PLATFORM_INT STREQUAL "OS64COMBINED") + set(SDK_NAME iphoneos) + if(MODERN_CMAKE) + if(NOT ARCHS) + if (XCODE_VERSION VERSION_GREATER 10.0) + set(ARCHS arm64 x86_64) # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example + else() + set(ARCHS arm64 x86_64) + endif() + endif() + else() + message(FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the OS64COMBINED setting work") + endif() +elseif(PLATFORM_INT STREQUAL "SIMULATOR") + set(SDK_NAME iphonesimulator) + if(NOT ARCHS) + set(ARCHS i386) + endif() + message(DEPRECATION "SIMULATOR IS DEPRECATED. Consider using SIMULATOR64 instead.") +elseif(PLATFORM_INT STREQUAL "SIMULATOR64") + set(SDK_NAME iphonesimulator) + if(NOT ARCHS) + set(ARCHS x86_64) + endif() +elseif(PLATFORM_INT STREQUAL "TVOS") + set(SDK_NAME appletvos) + if(NOT ARCHS) + set(ARCHS arm64) + endif() +elseif (PLATFORM_INT STREQUAL "TVOSCOMBINED") + set(SDK_NAME appletvos) + if(MODERN_CMAKE) + if(NOT ARCHS) + set(ARCHS arm64 x86_64) + endif() + else() + message(FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the TVOSCOMBINED setting work") + endif() +elseif(PLATFORM_INT STREQUAL "SIMULATOR_TVOS") + set(SDK_NAME appletvsimulator) + if(NOT ARCHS) + set(ARCHS x86_64) + endif() +elseif(PLATFORM_INT STREQUAL "WATCHOS") + set(SDK_NAME watchos) + if(NOT ARCHS) + if (XCODE_VERSION VERSION_GREATER 10.0) + set(ARCHS armv7k arm64_32) + else() + set(ARCHS armv7k) + endif() + endif() +elseif(PLATFORM_INT STREQUAL "WATCHOSCOMBINED") + set(SDK_NAME watchos) + if(MODERN_CMAKE) + if(NOT ARCHS) + if (XCODE_VERSION VERSION_GREATER 10.0) + set(ARCHS armv7k arm64_32 i386) + else() + set(ARCHS armv7k i386) + endif() + endif() + else() + message(FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the WATCHOSCOMBINED setting work") + endif() +elseif(PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS") + set(SDK_NAME watchsimulator) + if(NOT ARCHS) + set(ARCHS i386) + endif() +else() + message(FATAL_ERROR "Invalid PLATFORM: ${PLATFORM_INT}") +endif() +message(STATUS "Configuring ${SDK_NAME} build for platform: ${PLATFORM_INT}, architecture(s): ${ARCHS}") + +if(MODERN_CMAKE AND PLATFORM_INT MATCHES ".*COMBINED" AND NOT USED_CMAKE_GENERATOR MATCHES "Xcode") + message(FATAL_ERROR "The COMBINED options only work with Xcode generator, -G Xcode") +endif() + +# If user did not specify the SDK root to use, then query xcodebuild for it. +execute_process(COMMAND xcodebuild -version -sdk ${SDK_NAME} Path + OUTPUT_VARIABLE CMAKE_OSX_SYSROOT_INT + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) +if (NOT DEFINED CMAKE_OSX_SYSROOT_INT AND NOT DEFINED CMAKE_OSX_SYSROOT) + message(SEND_ERROR "Please make sure that Xcode is installed and that the toolchain" + "is pointing to the correct path. Please run:" + "sudo xcode-select -s /Applications/Xcode.app/Contents/Developer" + "and see if that fixes the problem for you.") + message(FATAL_ERROR "Invalid CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT} " + "does not exist.") +elseif(DEFINED CMAKE_OSX_SYSROOT) + message(STATUS "Using SDK: ${CMAKE_OSX_SYSROOT} for platform: ${PLATFORM_INT} when checking compatibility") +elseif(DEFINED CMAKE_OSX_SYSROOT_INT) + message(STATUS "Using SDK: ${CMAKE_OSX_SYSROOT_INT} for platform: ${PLATFORM_INT}") + set(CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT_INT}" CACHE INTERNAL "") +endif() + +# Set Xcode property for SDKROOT as well if Xcode generator is used +if(USED_CMAKE_GENERATOR MATCHES "Xcode") + set(CMAKE_OSX_SYSROOT "${SDK_NAME}" CACHE INTERNAL "") + if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM) + set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM 123456789A CACHE INTERNAL "") + endif() +endif() + +# Specify minimum version of deployment target. +if(NOT DEFINED DEPLOYMENT_TARGET) + if (PLATFORM_INT STREQUAL "WATCHOS" OR PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS") + # Unless specified, SDK version 2.0 is used by default as minimum target version (watchOS). + set(DEPLOYMENT_TARGET "2.0" + CACHE STRING "Minimum SDK version to build for." ) + else() + # Unless specified, SDK version 9.0 is used by default as minimum target version (iOS, tvOS). + set(DEPLOYMENT_TARGET "9.0" + CACHE STRING "Minimum SDK version to build for." ) + endif() + message(STATUS "Using the default min-version since DEPLOYMENT_TARGET not provided!") +endif() +# Use bitcode or not +if(NOT DEFINED ENABLE_BITCODE AND NOT ARCHS MATCHES "((^|, )(i386|x86_64))+") + # Unless specified, enable bitcode support by default + message(STATUS "Enabling bitcode support by default. ENABLE_BITCODE not provided!") + set(ENABLE_BITCODE TRUE) +elseif(NOT DEFINED ENABLE_BITCODE) + message(STATUS "Disabling bitcode support by default on simulators. ENABLE_BITCODE not provided for override!") + set(ENABLE_BITCODE FALSE) +endif() +set(ENABLE_BITCODE_INT ${ENABLE_BITCODE} CACHE BOOL "Whether or not to enable bitcode" ${FORCE_CACHE}) +# Use ARC or not +if(NOT DEFINED ENABLE_ARC) + # Unless specified, enable ARC support by default + set(ENABLE_ARC TRUE) + message(STATUS "Enabling ARC support by default. ENABLE_ARC not provided!") +endif() +set(ENABLE_ARC_INT ${ENABLE_ARC} CACHE BOOL "Whether or not to enable ARC" ${FORCE_CACHE}) +# Use hidden visibility or not +if(NOT DEFINED ENABLE_VISIBILITY) + # Unless specified, disable symbols visibility by default + set(ENABLE_VISIBILITY FALSE) + message(STATUS "Hiding symbols visibility by default. ENABLE_VISIBILITY not provided!") +endif() +set(ENABLE_VISIBILITY_INT ${ENABLE_VISIBILITY} CACHE BOOL "Whether or not to hide symbols (-fvisibility=hidden)" ${FORCE_CACHE}) +# Get the SDK version information. +execute_process(COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version SDKVersion + OUTPUT_VARIABLE SDK_VERSION + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + +# Find the Developer root for the specific iOS platform being compiled for +# from CMAKE_OSX_SYSROOT. Should be ../../ from SDK specified in +# CMAKE_OSX_SYSROOT. There does not appear to be a direct way to obtain +# this information from xcrun or xcodebuild. +if (NOT DEFINED CMAKE_DEVELOPER_ROOT AND NOT USED_CMAKE_GENERATOR MATCHES "Xcode") + get_filename_component(PLATFORM_SDK_DIR ${CMAKE_OSX_SYSROOT} PATH) + get_filename_component(CMAKE_DEVELOPER_ROOT ${PLATFORM_SDK_DIR} PATH) + + if (NOT DEFINED CMAKE_DEVELOPER_ROOT) + message(FATAL_ERROR "Invalid CMAKE_DEVELOPER_ROOT: " + "${CMAKE_DEVELOPER_ROOT} does not exist.") + endif() +endif() +# Find the C & C++ compilers for the specified SDK. +if(NOT CMAKE_C_COMPILER) + execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find clang + OUTPUT_VARIABLE CMAKE_C_COMPILER + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + message(STATUS "Using C compiler: ${CMAKE_C_COMPILER}") +endif() +if(NOT CMAKE_CXX_COMPILER) + execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find clang++ + OUTPUT_VARIABLE CMAKE_CXX_COMPILER + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + message(STATUS "Using CXX compiler: ${CMAKE_CXX_COMPILER}") +endif() +# Find (Apple's) libtool. +execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find libtool + OUTPUT_VARIABLE BUILD_LIBTOOL + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) +message(STATUS "Using libtool: ${BUILD_LIBTOOL}") +# Configure libtool to be used instead of ar + ranlib to build static libraries. +# This is required on Xcode 7+, but should also work on previous versions of +# Xcode. +set(CMAKE_C_CREATE_STATIC_LIBRARY + "${BUILD_LIBTOOL} -static -o ") +set(CMAKE_CXX_CREATE_STATIC_LIBRARY + "${BUILD_LIBTOOL} -static -o ") +# Get the version of Darwin (OS X) of the host. +execute_process(COMMAND uname -r + OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) +# CMake 3.14+ support building for iOS, watchOS and tvOS out of the box. +if(MODERN_CMAKE) + if(SDK_NAME MATCHES "iphone") + set(CMAKE_SYSTEM_NAME iOS CACHE INTERNAL "" ${FORCE_CACHE}) + elseif(SDK_NAME MATCHES "appletv") + set(CMAKE_SYSTEM_NAME tvOS CACHE INTERNAL "" ${FORCE_CACHE}) + elseif(SDK_NAME MATCHES "watch") + set(CMAKE_SYSTEM_NAME watchOS CACHE INTERNAL "" ${FORCE_CACHE}) + endif() + + # Provide flags for a combined FAT library build on newer CMake versions + if(PLATFORM_INT MATCHES ".*COMBINED") + set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH NO CACHE INTERNAL "") + set(CMAKE_IOS_INSTALL_COMBINED YES CACHE INTERNAL "") + message(STATUS "Will combine built (static) artifacts into FAT lib...") + endif() +else() + # Legacy code path prior to CMake 3.14 + set(CMAKE_SYSTEM_NAME Darwin CACHE INTERNAL "" ${FORCE_CACHE}) +endif() +# Standard settings. +set(CMAKE_SYSTEM_VERSION ${SDK_VERSION} CACHE INTERNAL "") +set(UNIX TRUE CACHE BOOL "") +set(APPLE TRUE CACHE BOOL "") +set(IOS TRUE CACHE BOOL "") +set(CMAKE_AR ar CACHE FILEPATH "" FORCE) +set(CMAKE_RANLIB ranlib CACHE FILEPATH "" FORCE) +set(CMAKE_STRIP strip CACHE FILEPATH "" FORCE) +# Set the architectures for which to build. +set(CMAKE_OSX_ARCHITECTURES ${ARCHS} CACHE STRING "Build architecture for iOS") +# Change the type of target generated for try_compile() so it'll work when cross-compiling +set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) +# All iOS/Darwin specific settings - some may be redundant. +set(CMAKE_SHARED_LIBRARY_PREFIX "lib") +set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib") +set(CMAKE_SHARED_MODULE_PREFIX "lib") +set(CMAKE_SHARED_MODULE_SUFFIX ".so") +set(CMAKE_C_COMPILER_ABI ELF) +set(CMAKE_CXX_COMPILER_ABI ELF) +set(CMAKE_C_HAS_ISYSROOT 1) +set(CMAKE_CXX_HAS_ISYSROOT 1) +set(CMAKE_MODULE_EXISTS 1) +set(CMAKE_DL_LIBS "") +set(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ") +set(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ") +set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}") +set(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}") + +if(ARCHS MATCHES "((^|, )(arm64|arm64e|x86_64))+") + set(CMAKE_C_SIZEOF_DATA_PTR 8) + set(CMAKE_CXX_SIZEOF_DATA_PTR 8) + if(ARCHS MATCHES "((^|, )(arm64|arm64e))+") + set(CMAKE_SYSTEM_PROCESSOR "arm64") + else() + set(CMAKE_SYSTEM_PROCESSOR "x86_64") + endif() + message(STATUS "Using a data_ptr size of 8") +else() + set(CMAKE_C_SIZEOF_DATA_PTR 4) + set(CMAKE_CXX_SIZEOF_DATA_PTR 4) + set(CMAKE_SYSTEM_PROCESSOR "arm") + message(STATUS "Using a data_ptr size of 4") +endif() + +message(STATUS "Building for minimum ${SDK_NAME} version: ${DEPLOYMENT_TARGET}" + " (SDK version: ${SDK_VERSION})") +# Note that only Xcode 7+ supports the newer more specific: +# -m${SDK_NAME}-version-min flags, older versions of Xcode use: +# -m(ios/ios-simulator)-version-min instead. +if(PLATFORM_INT STREQUAL "OS" OR PLATFORM_INT STREQUAL "OS64") + if(XCODE_VERSION VERSION_LESS 7.0) + set(SDK_NAME_VERSION_FLAGS + "-mios-version-min=${DEPLOYMENT_TARGET}") + else() + # Xcode 7.0+ uses flags we can build directly from SDK_NAME. + set(SDK_NAME_VERSION_FLAGS + "-m${SDK_NAME}-version-min=${DEPLOYMENT_TARGET}") + endif() +elseif(PLATFORM_INT STREQUAL "TVOS") + set(SDK_NAME_VERSION_FLAGS + "-mtvos-version-min=${DEPLOYMENT_TARGET}") +elseif(PLATFORM_INT STREQUAL "SIMULATOR_TVOS") + set(SDK_NAME_VERSION_FLAGS + "-mtvos-simulator-version-min=${DEPLOYMENT_TARGET}") +elseif(PLATFORM_INT STREQUAL "WATCHOS") + set(SDK_NAME_VERSION_FLAGS + "-mwatchos-version-min=${DEPLOYMENT_TARGET}") +elseif(PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS") + set(SDK_NAME_VERSION_FLAGS + "-mwatchos-simulator-version-min=${DEPLOYMENT_TARGET}") +else() + # SIMULATOR or SIMULATOR64 both use -mios-simulator-version-min. + set(SDK_NAME_VERSION_FLAGS + "-mios-simulator-version-min=${DEPLOYMENT_TARGET}") +endif() +message(STATUS "Version flags set to: ${SDK_NAME_VERSION_FLAGS}") +set(CMAKE_OSX_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET} CACHE STRING + "Set CMake deployment target" ${FORCE_CACHE}) + +if(ENABLE_BITCODE_INT) + set(BITCODE "-fembed-bitcode") + set(CMAKE_XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE bitcode CACHE INTERNAL "") + message(STATUS "Enabling bitcode support.") +else() + set(BITCODE "") + set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE NO CACHE INTERNAL "") + message(STATUS "Disabling bitcode support.") +endif() + +if(ENABLE_ARC_INT) + set(FOBJC_ARC "-fobjc-arc") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES CACHE INTERNAL "") + message(STATUS "Enabling ARC support.") +else() + set(FOBJC_ARC "-fno-objc-arc") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC NO CACHE INTERNAL "") + message(STATUS "Disabling ARC support.") +endif() + +if(NOT ENABLE_VISIBILITY_INT) + set(VISIBILITY "-fvisibility=hidden") + set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN YES CACHE INTERNAL "") + message(STATUS "Hiding symbols (-fvisibility=hidden).") +else() + set(VISIBILITY "") + set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN NO CACHE INTERNAL "") +endif() + +#Check if Xcode generator is used, since that will handle these flags automagically +if(USED_CMAKE_GENERATOR MATCHES "Xcode") + message(STATUS "Not setting any manual command-line buildflags, since Xcode is selected as generator.") +else() + set(CMAKE_C_FLAGS + "${SDK_NAME_VERSION_FLAGS} ${BITCODE} -fobjc-abi-version=2 ${FOBJC_ARC} ${CMAKE_C_FLAGS}") + # Hidden visibilty is required for C++ on iOS. + set(CMAKE_CXX_FLAGS + "${SDK_NAME_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} -fvisibility-inlines-hidden -fobjc-abi-version=2 ${FOBJC_ARC} ${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -O0 -g ${CMAKE_CXX_FLAGS_DEBUG}") + set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DNDEBUG -Os -ffast-math ${CMAKE_CXX_FLAGS_MINSIZEREL}") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -DNDEBUG -O2 -g -ffast-math ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG -O3 -ffast-math ${CMAKE_CXX_FLAGS_RELEASE}") + set(CMAKE_C_LINK_FLAGS "${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}") + set(CMAKE_CXX_LINK_FLAGS "${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}") + + # In order to ensure that the updated compiler flags are used in try_compile() + # tests, we have to forcibly set them in the CMake cache, not merely set them + # in the local scope. + list(APPEND VARS_TO_FORCE_IN_CACHE + CMAKE_C_FLAGS + CMAKE_CXX_FLAGS + CMAKE_CXX_FLAGS_DEBUG + CMAKE_CXX_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS_MINSIZEREL + CMAKE_CXX_FLAGS_RELEASE + CMAKE_C_LINK_FLAGS + CMAKE_CXX_LINK_FLAGS) + foreach(VAR_TO_FORCE ${VARS_TO_FORCE_IN_CACHE}) + set(${VAR_TO_FORCE} "${${VAR_TO_FORCE}}" CACHE STRING "") + endforeach() +endif() + +set(CMAKE_PLATFORM_HAS_INSTALLNAME 1) +set(CMAKE_SHARED_LINKER_FLAGS "-rpath @executable_path/Frameworks -rpath @loader_path/Frameworks") +set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names") +set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names") +set(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,") +set(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,") +set(CMAKE_FIND_LIBRARY_SUFFIXES ".tbd" ".dylib" ".so" ".a") +set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name") + +# Hack: if a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old +# build tree (where install_name_tool was hardcoded) and where +# CMAKE_INSTALL_NAME_TOOL isn't in the cache and still cmake didn't fail in +# CMakeFindBinUtils.cmake (because it isn't rerun) hardcode +# CMAKE_INSTALL_NAME_TOOL here to install_name_tool, so it behaves as it did +# before, Alex. +if(NOT DEFINED CMAKE_INSTALL_NAME_TOOL) + find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool) +endif(NOT DEFINED CMAKE_INSTALL_NAME_TOOL) + +# Set the find root to the iOS developer roots and to user defined paths. +set(CMAKE_FIND_ROOT_PATH ${CMAKE_DEVELOPER_ROOT} ${CMAKE_OSX_SYSROOT_INT} + ${CMAKE_PREFIX_PATH} CACHE STRING "Root path that will be prepended to all search paths") +# Default to searching for frameworks first. +set(CMAKE_FIND_FRAMEWORK FIRST) +# Set up the default search directories for frameworks. +set(CMAKE_FRAMEWORK_PATH + ${CMAKE_DEVELOPER_ROOT}/Library/Frameworks + ${CMAKE_DEVELOPER_ROOT}/Library/PrivateFrameworks + ${CMAKE_OSX_SYSROOT_INT}/System/Library/Frameworks + ${CMAKE_FRAMEWORK_PATH} CACHE STRING "Frameworks search paths") + +# By default, search both the specified iOS SDK and the remainder of the host filesystem. +if(NOT CMAKE_FIND_ROOT_PATH_MODE_PROGRAM) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH CACHE STRING "" ${FORCE_CACHE}) +endif() +if(NOT CMAKE_FIND_ROOT_PATH_MODE_LIBRARY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH CACHE STRING "" ${FORCE_CACHE}) +endif() +if(NOT CMAKE_FIND_ROOT_PATH_MODE_INCLUDE) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH CACHE STRING "" ${FORCE_CACHE}) +endif() +if(NOT CMAKE_FIND_ROOT_PATH_MODE_PACKAGE) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH CACHE STRING "" ${FORCE_CACHE}) +endif() + +# +# Some helper-macros below to simplify and beautify the CMakeFile +# + +# This little macro lets you set any XCode specific property. +macro(set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE XCODE_RELVERSION) + set(XCODE_RELVERSION_I "${XCODE_RELVERSION}") + if(XCODE_RELVERSION_I STREQUAL "All") + set_property(TARGET ${TARGET} PROPERTY + XCODE_ATTRIBUTE_${XCODE_PROPERTY} "${XCODE_VALUE}") + else() + set_property(TARGET ${TARGET} PROPERTY + XCODE_ATTRIBUTE_${XCODE_PROPERTY}[variant=${XCODE_RELVERSION_I}] "${XCODE_VALUE}") + endif() +endmacro(set_xcode_property) +# This macro lets you find executable programs on the host system. +macro(find_host_package) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER) + set(IOS FALSE) + find_package(${ARGN}) + set(IOS TRUE) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) +endmacro(find_host_package) diff --git a/ios/libuv/README.md b/ios/libuv/README.md new file mode 100644 index 0000000000..6ce7ef1b8a --- /dev/null +++ b/ios/libuv/README.md @@ -0,0 +1,11 @@ +To compile libuv for iOS, download it from https://github.com/libuv/libuv/, copy ios-configure-arm64 to its root folder, and execute: + +``` +brew install autoconf (if you don't have it installed already) +bash autogen.sh +chmod +x ios-configure-arm64 +./ios-configure-arm64 +``` + +libuv was at version 1.30.1 when it was last compiled for iOS. + diff --git a/ios/libuv/ios-configure-arm64 b/ios/libuv/ios-configure-arm64 new file mode 100755 index 0000000000..4ff6c6d30c --- /dev/null +++ b/ios/libuv/ios-configure-arm64 @@ -0,0 +1,78 @@ +#!/bin/bash + +PLATFORMPATH="/Applications/Xcode.app/Contents/Developer/Platforms" +TOOLSPATH="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin" +export IPHONEOS_DEPLOYMENT_TARGET="10.0" +pwd=`pwd` + +findLatestSDKVersion() +{ + sdks=`ls $PLATFORMPATH/$1.platform/Developer/SDKs` + arr=() + for sdk in $sdks + do + echo $sdk + arr[${#arr[@]}]=$sdk + done + + # Last item will be the current SDK, since it is alpha ordered + count=${#arr[@]} + if [ $count -gt 0 ]; then + sdk=${arr[$count-1]:${#1}} + num=`expr ${#sdk}-4` + SDKVERSION=${sdk:0:$num} + else + SDKVERSION="10.0" + fi +} + +buildit() +{ + target=$1 + hosttarget=$1 + platform=$2 + + if [[ $hosttarget == "x86_64" ]]; then + xxhosttarget="i386" + elif [[ $hosttarget == "arm64" ]]; then + hosttarget="arm" + fi + + echo "" + echo "-------------------------------------------------------------------------------" + echo " Compiling for $platform on $target" + echo "-------------------------------------------------------------------------------" + + export PLATFORM=$platform + export CC="$(xcrun -sdk iphoneos -find clang)" + export STRIP="$(xcrun -sdk iphoneos -find strip)" + export LD="$(xcrun -sdk iphoneos -find ld)" + export CPP="$CC -E" + export CFLAGS="-arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform$SDKVERSION.sdk -miphoneos-version-min=$SDKMINVERSION" + export AR=$(xcrun -sdk iphoneos -find ar) + export RANLIB=$(xcrun -sdk iphoneos -find ranlib) + export CPPFLAGS="-arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform$SDKVERSION.sdk -miphoneos-version-min=$SDKMINVERSION" + export LDFLAGS="-arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform$SDKVERSION.sdk" + + ./configure --prefix="$pwd/output/$target" --host=$hosttarget-apple-darwin + + make clean + make + make install + install_name_tool -id libuv.1.dylib $pwd/output/$target/lib/libuv.1.dylib +} + +findLatestSDKVersion iPhoneOS +SDKMINVERSION="10.0" + +buildit arm64 iPhoneOS +buildit i386 iPhoneSimulator +buildit x86_64 iPhoneSimulator + +LIPO=$(xcrun -sdk iphoneos -find lipo) +$LIPO -create $pwd/output/arm64/lib/libuv.a $pwd/output/x86_64/lib/libuv.a $pwd/output/i386/lib/libuv.a -output libuv.a +$LIPO -create $pwd/output/arm64/lib/libuv.1.dylib $pwd/output/x86_64/lib/libuv.1.dylib $pwd/output/i386/lib/libuv.1.dylib -output libuv.1.dylib + +install_name_tool -id @rpath/libuv.1.dylib libuv.1.dylib + +echo "done." diff --git a/ios/libuv/libuv-ios-arm64.dylib b/ios/libuv/libuv-ios-arm64.dylib new file mode 100755 index 0000000000..f2665dd34b Binary files /dev/null and b/ios/libuv/libuv-ios-arm64.dylib differ diff --git a/ios/libuv/libuv.1.dylib b/ios/libuv/libuv.1.dylib new file mode 100755 index 0000000000..fa82407326 Binary files /dev/null and b/ios/libuv/libuv.1.dylib differ diff --git a/llarp/ev/ev.hpp b/llarp/ev/ev.hpp index a6492c6108..a8ed0d94f2 100644 --- a/llarp/ev/ev.hpp +++ b/llarp/ev/ev.hpp @@ -570,9 +570,7 @@ namespace llarp tcp.close = &DoClose; } - virtual ~tcp_conn() - { - } + virtual ~tcp_conn(); /// start connecting void diff --git a/llarp/hook/shell.cpp b/llarp/hook/shell.cpp index 5e6bcac6bc..341d712b74 100644 --- a/llarp/hook/shell.cpp +++ b/llarp/hook/shell.cpp @@ -11,7 +11,7 @@ extern char **environ; #endif #endif -#if defined(Darwin) +#if defined(Darwin) && !defined(iOS) #include #endif @@ -99,7 +99,7 @@ namespace llarp const std::unordered_map< std::string, std::string > env) : m_Parent(b) { -#if defined(Darwin) +#if defined(Darwin) && !defined(iOS) char **ptr = *_NSGetEnviron(); #else char **ptr = environ; diff --git a/testAll/Images.xcassets/AppIcon.appiconset/Contents.json b/testAll/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..19882d568a --- /dev/null +++ b/testAll/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,53 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/testAll/Images.xcassets/Contents.json b/testAll/Images.xcassets/Contents.json new file mode 100644 index 0000000000..da4a164c91 --- /dev/null +++ b/testAll/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/testAll/Images.xcassets/LaunchImage.launchimage/Contents.json b/testAll/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000000..e37b649490 --- /dev/null +++ b/testAll/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "minimum-system-version" : "7.0", + "subtype" : "retina4", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/vendor/cppbackport-master/lib/fs/path.h b/vendor/cppbackport-master/lib/fs/path.h index e72d1a585c..9f38e50ca3 100644 --- a/vendor/cppbackport-master/lib/fs/path.h +++ b/vendor/cppbackport-master/lib/fs/path.h @@ -63,6 +63,11 @@ class path path(const char*); + template< typename Iterator > + path(Iterator first, Iterator last) : s(first, last) + { + } + /// Copy constructor path(const path&); diff --git a/vendor/libtuntap-master/tuntap-unix-darwin.c b/vendor/libtuntap-master/tuntap-unix-darwin.c index bee69844c8..24f3fb1603 100644 --- a/vendor/libtuntap-master/tuntap-unix-darwin.c +++ b/vendor/libtuntap-master/tuntap-unix-darwin.c @@ -23,8 +23,10 @@ #include #include #include +#if !defined(iOS) #include #include +#endif #include #include @@ -37,9 +39,11 @@ #include #include "tuntap.h" +#if !defined(iOS) #include #include #include +#endif #define APPLE_UTUN "com.apple.net.utun_control" #define UTUN_OPT_IFNAME 2 @@ -47,6 +51,7 @@ int tuntap_sys_start(struct device *dev, int mode, int tun) { +#if !defined(iOS) (void)mode; (void)tun; uint32_t namesz = IFNAMSIZ; @@ -92,6 +97,9 @@ tuntap_sys_start(struct device *dev, int mode, int tun) strncpy(dev->if_name, ifname, sizeof(dev->if_name)); return fd; +#else + return 0; // TODO: Implement for iOS +#endif } void @@ -102,7 +110,9 @@ tuntap_sys_destroy(struct device *dev) struct tuntap_rtmsg { +#if !defined(iOS) struct rt_msghdr hdr; +#endif struct sockaddr_in saddr; struct sockaddr_in mask; struct sockaddr_in daddr; @@ -111,6 +121,8 @@ struct tuntap_rtmsg int tuntap_sys_set_ipv4(struct device *dev, t_tun_in_addr *s4, uint32_t bits) { +// TODO: Implement for iOS +#if !defined(iOS) struct sockaddr_in mask; mask.sin_family = AF_INET; mask.sin_addr.s_addr = bits; @@ -119,12 +131,12 @@ tuntap_sys_set_ipv4(struct device *dev, t_tun_in_addr *s4, uint32_t bits) inet_ntop(AF_INET, s4, addrbuf, sizeof(addrbuf)); char buf[1028]; const char *addr = addrbuf; - + char daddrbuf[32]; in_addr_t daddr_s4 = {s4->s_addr & bits}; inet_ntop(AF_INET, &daddr_s4, daddrbuf, sizeof(daddrbuf)); const char *daddr = daddrbuf; - + const char *netmask = inet_ntoa(mask.sin_addr); /** because fuck this other stuff */ snprintf(buf, sizeof(buf), "ifconfig %s %s %s mtu 1380 netmask 255.255.255.255 up", @@ -142,6 +154,7 @@ tuntap_sys_set_ipv4(struct device *dev, t_tun_in_addr *s4, uint32_t bits) "route add %s -interface lo0", addr); tuntap_log(TUNTAP_LOG_INFO, buf); system(buf); +#endif /* Simpler than calling SIOCSIFADDR and/or SIOCSIFBRDADDR */ /* diff --git a/vendor/libtuntap-master/tuntap-unix.c b/vendor/libtuntap-master/tuntap-unix.c index e2c044c5e7..d49ebf970b 100644 --- a/vendor/libtuntap-master/tuntap-unix.c +++ b/vendor/libtuntap-master/tuntap-unix.c @@ -52,7 +52,9 @@ #else #include #endif +#if !defined(iOS) #include +#endif #include #endif