Unzip NordVPN external resources to cache

This commit is contained in:
Davide De Rosa 2019-04-11 18:07:59 +02:00
parent 2088795a9c
commit e0c8b478bb
4 changed files with 19 additions and 3 deletions

View File

@ -861,6 +861,7 @@
"${PODS_ROOT}/Target Support Files/Pods-Passepartout-iOS/Pods-Passepartout-iOS-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/MBProgressHUD/MBProgressHUD.framework",
"${PODS_ROOT}/OpenSSL-Apple/frameworks/iPhone/openssl.framework",
"${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework",
"${BUILT_PRODUCTS_DIR}/SwiftyBeaver/SwiftyBeaver.framework",
"${BUILT_PRODUCTS_DIR}/TunnelKit/TunnelKit.framework",
);
@ -870,6 +871,7 @@
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MBProgressHUD.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyBeaver.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TunnelKit.framework",
);
@ -954,6 +956,7 @@
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Passepartout-CoreTests/Pods-Passepartout-CoreTests-frameworks.sh",
"${PODS_ROOT}/OpenSSL-Apple/frameworks/iPhone/openssl.framework",
"${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework",
"${BUILT_PRODUCTS_DIR}/SwiftyBeaver/SwiftyBeaver.framework",
"${BUILT_PRODUCTS_DIR}/TunnelKit/TunnelKit.framework",
);
@ -962,6 +965,7 @@
);
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyBeaver.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TunnelKit.framework",
);

View File

@ -24,7 +24,7 @@
//
import Foundation
import TunnelKit
import SSZipArchive
public struct Infrastructure: Codable {
public enum Name: String, Codable, Comparable {
@ -89,10 +89,17 @@ extension Infrastructure.Name {
}
public func importExternalResources(from url: URL, completionHandler: @escaping () -> Void) {
var task: () -> Void
switch self {
case .nordVPN:
task = {
SSZipArchive.unzipFile(atPath: url.path, toDestination: self.externalURL.path)
}
default:
break
task = {}
}
execute(task: task, completionHandler: completionHandler)
}
private func execute(task: @escaping () -> Void, completionHandler: @escaping () -> Void) {

View File

@ -9,6 +9,7 @@ def shared_pods
pod 'TunnelKit/LZO', :git => 'https://github.com/keeshux/tunnelkit', :commit => '4af8305'
#pod 'TunnelKit', :path => '../../personal/tunnelkit'
#pod 'TunnelKit/LZO', :path => '../../personal/tunnelkit'
pod 'SSZipArchive'
end
target 'Passepartout-Core' do

View File

@ -1,6 +1,7 @@
PODS:
- MBProgressHUD (1.1.0)
- OpenSSL-Apple (1.1.0i.2)
- SSZipArchive (2.1.4)
- SwiftyBeaver (1.7.0)
- TunnelKit (1.6.2):
- TunnelKit/AppExtension (= 1.6.2)
@ -15,6 +16,7 @@ PODS:
DEPENDENCIES:
- MBProgressHUD
- SSZipArchive
- TunnelKit (from `https://github.com/keeshux/tunnelkit`, commit `4af8305`)
- TunnelKit/LZO (from `https://github.com/keeshux/tunnelkit`, commit `4af8305`)
@ -22,6 +24,7 @@ SPEC REPOS:
https://github.com/cocoapods/specs.git:
- MBProgressHUD
- OpenSSL-Apple
- SSZipArchive
- SwiftyBeaver
EXTERNAL SOURCES:
@ -37,9 +40,10 @@ CHECKOUT OPTIONS:
SPEC CHECKSUMS:
MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9
OpenSSL-Apple: 37a8c0b04df4bb8971deef4671cc29222861319c
SSZipArchive: 41455d4b8d2b6ab93990820b50dc697c2554a322
SwiftyBeaver: 4cc0080d2e23f980652e28978db11a5c9da39165
TunnelKit: 6be99150922d3f14187dc29732032712dd4400e3
PODFILE CHECKSUM: 2447c6354060c9edf9e9c5e1f1cf276750540090
PODFILE CHECKSUM: 3eb482b1422e230476ee092236e7b47d3ac13025
COCOAPODS: 1.6.1