Permalink
Browse files

Migrate to Swift 3 for all. Made it buildable on iOS 10 device.

Changes also included
- set not to ignore Podfile.lock

When you clone this project and build on your system, you need to do
this thing (based on Xcode 8.2 and iOS 10.2 device).

- Add @escaping in front of callback parameters for ActionHandler as
  defined on top of the file
- Request to use some features in Network extension API by making a
  request to Apple via
  https://developer.apple.com/contact/network-extension/.

Right now, this changes are still waiting for response back from Apple
from step 2 above. As tested, if not request and get permission from
Apple to use core feature in Network extension as needed in this
project, it will always failed similar to "permission denied".

It seems like Apple ties team account string to be able to use such
features of Network extension API.
  • Loading branch information...
haxpor committed Dec 17, 2016
1 parent 0f76b6e commit c61c5159932a0ac7a2299f895aa932b4eb69aedc
Showing with 1,900 additions and 1,572 deletions.
  1. +2 −1 .gitignore
  2. +4 −4 Library/Aspects/Aspects/Source/Aspects.swift
  3. +11 −11 Library/ICSMainFramework/ICSMainFramework/AppConfiguration.swift
  4. +16 −16 Library/ICSMainFramework/ICSMainFramework/AppDelegate.swift
  5. +10 −10 Library/ICSMainFramework/ICSMainFramework/AppEnvironment.swift
  6. +4 −4 Library/ShadowPath/ShadowPath.xcodeproj/project.pbxproj
  7. +1 −1 PacketProcessor/TunnelInterface.m
  8. +2 −2 PacketProcessor/tun2socks-iOS/system/BTime.c
  9. +1 −1 PacketProcessor/tun2socks-iOS/system/BTime.h
  10. +4 −2 PacketTunnel/Info.plist
  11. +4 −6 PacketTunnel/{Supporting Files → }/PacketTunnel.entitlements
  12. +1 −1 PacketTunnel/PacketTunnelProvider.m
  13. +3 −3 PacketTunnel/ProxyManager.m
  14. +1 −1 PacketTunnel/TunnelError.m
  15. +1 −1 Podfile
  16. +141 −0 Podfile.lock
  17. +150 −61 Potatso.xcodeproj/project.pbxproj
  18. +4 −4 Potatso.xcworkspace/xcshareddata/Potatso.xcscmblueprint
  19. +20 −20 Potatso/Advance/ProxyConfigurationViewController.swift
  20. +9 −9 Potatso/Advance/ProxySelectionViewController.swift
  21. +8 −8 Potatso/Advance/RuleConfigurationViewController.swift
  22. +16 −16 Potatso/Advance/RuleSetConfigurationViewController.swift
  23. +7 −7 Potatso/Advance/RuleSetsSelectionViewController.swift
  24. +14 −14 Potatso/AppInitializer.swift
  25. +20 −0 Potatso/Assets.xcassets/AppIcon.appiconset/Contents.json
  26. +3 −3 Potatso/Base/ActionRow.swift
  27. +3 −3 Potatso/Base/BaseEmptyView.swift
  28. +4 −4 Potatso/Base/BaseSafariViewController.swift
  29. +15 −11 Potatso/Base/RequestEventRow.swift
  30. +6 −6 Potatso/Base/SegmentPageVC.swift
  31. +26 −26 Potatso/CloudDetailViewController.swift
  32. +12 −12 Potatso/CloudViewController.swift
  33. +4 −4 Potatso/CollectionViewController.swift
  34. +18 −18 Potatso/ConfigGroupCell.swift
  35. +35 −35 Potatso/ConfigGroupChooseVC.swift
  36. +86 −72 Potatso/Core/API.swift
  37. +12 −4 Potatso/Core/CloudSetManager.swift
  38. +5 −5 Potatso/Core/FeedbackManager.swift
  39. +24 −24 Potatso/Core/Importer.swift
  40. +2 −2 Potatso/Core/User.swift
  41. +3 −3 Potatso/Core/VPN.swift
  42. +25 −24 Potatso/DashboardVC.swift
  43. +4 −4 Potatso/DataInitializer.swift
  44. +5 −5 Potatso/FlatButton.swift
  45. +27 −27 Potatso/HomePresenter.swift
  46. +42 −42 Potatso/HomeVC.swift
  47. +1 −2 Potatso/Info.plist
  48. +23 −23 Potatso/LogDetailViewController.swift
  49. +11 −11 Potatso/More/SettingsViewController.swift
  50. +17 −17 Potatso/NotificationHandler.swift
  51. +11 −9 Potatso/PaddingLabel.swift
  52. +6 −6 Potatso/Potatso.entitlements
  53. +15 −15 Potatso/ProxyListViewController.swift
  54. +11 −7 Potatso/ProxyRow.swift
  55. +25 −25 Potatso/RecentRequestsCell.swift
  56. +28 −28 Potatso/RecentRequestsVC.swift
  57. +128 −128 Potatso/RequestModel.swift
  58. +9 −9 Potatso/RequestOverviewVC.swift
  59. +4 −4 Potatso/RuleCell.swift
  60. +17 −17 Potatso/RuleSetCell.swift
  61. +28 −28 Potatso/RuleSetListViewController.swift
  62. +8 −8 Potatso/Sync/AlertOperation.swift
  63. +28 −22 Potatso/Sync/CloudKitRecord.swift
  64. +25 −24 Potatso/Sync/FetchCloudChangesOperation.swift
  65. +4 −4 Potatso/Sync/ICloudSetupOperation.swift
  66. +7 −7 Potatso/Sync/ICloudSyncService.swift
  67. +9 −8 Potatso/Sync/PrepareZoneOperation.swift
  68. +28 −26 Potatso/Sync/PushLocalChangesBaseOperation.swift
  69. +6 −6 Potatso/Sync/PushLocalChangesOperation.swift
  70. +1 −1 Potatso/Sync/PushLocalDeletedChangesOperation.swift
  71. +1 −1 Potatso/Sync/PushLocalModifiedChangesOperation.swift
  72. +64 −63 Potatso/Sync/RealmCloud.swift
  73. +19 −19 Potatso/Sync/SyncManager.swift
  74. +6 −6 Potatso/Sync/SyncVC.swift
  75. +4 −4 Potatso/UIManager.swift
  76. +19 −22 Potatso/UIViewControllerExtensions.swift
  77. +17 −17 Potatso/UrlHandler.swift
  78. +10 −10 Potatso/Utils/AlertUtils.swift
  79. +2 −2 Potatso/Utils/Error.swift
  80. +3 −3 Potatso/Utils/Event.swift
  81. +8 −8 Potatso/Utils/HUDUtils.swift
  82. +1 −1 Potatso/Utils/KeychainUtils.swift
  83. +2 −2 Potatso/Utils/LoggerUtils.swift
  84. +17 −17 Potatso/Utils/Receipt.swift
  85. +3 −3 Potatso/Utils/RegexUtils.swift
  86. +22 −22 PotatsoBase/Localized.swift
  87. +1 −1 PotatsoBase/NSError+Helper.m
  88. +1 −1 PotatsoBase/Potatso.m
  89. +17 −17 PotatsoLibrary/Config.swift
  90. +3 −3 PotatsoLibrary/Image.swift
  91. +10 −10 PotatsoLibrary/Logging.swift
  92. +126 −119 PotatsoLibrary/Manager.swift
  93. +18 −18 PotatsoModel/BaseModel.swift
  94. +23 −23 PotatsoModel/ConfigurationGroup.swift
  95. +62 −32 PotatsoModel/DBUtils.swift
  96. +89 −89 PotatsoModel/Proxy.swift
  97. +16 −16 PotatsoModel/Rule.swift
  98. +21 −21 PotatsoModel/RuleSet.swift
  99. +1 −1 PotatsoTests/PotatsoTests.swift
  100. +10 −10 TodayWidget/CurrentGroupCell.swift
  101. +5 −3 TodayWidget/Info.plist
  102. +30 −30 TodayWidget/TodayViewController.swift
  103. +4 −6 TodayWidget/TodayWidget.entitlements
View
@@ -42,7 +42,8 @@ DerivedData
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
Pods/
Podfile.lock
# Add Podfile.lock for future maintenance reason
#Podfile.lock
# Carthage
Carthage/Build
@@ -15,14 +15,14 @@ struct Aspect {
}
public enum AspectOptions {
case Before
case After
case Instead
case before
case after
case instead
}
public extension NSObject {
public class func aspectHook(originalSelector: Selector, swizzledSelector: Selector, options: AspectOptions = .Instead) {
public class func aspectHook(_ originalSelector: Selector, swizzledSelector: Selector, options: AspectOptions = .instead) {
let originalMethod = class_getInstanceMethod(self, originalSelector)
let swizzledMethod = class_getInstanceMethod(self, swizzledSelector)
@@ -27,26 +27,26 @@ public struct LifeCycleKey {
let appConfig = AppConfig.sharedConfig
public class AppConfig {
open class AppConfig {
public var lifeCycleConfig = [String: [AppLifeCycleItem]]()
public var customConfig = [String: AnyObject]()
open var lifeCycleConfig = [String: [AppLifeCycleItem]]()
open var customConfig = [String: AnyObject]()
public class var sharedConfig: AppConfig {
open class var sharedConfig: AppConfig {
return sharedConfigInstance
}
public func loadConfig(fileName: String) {
var components = fileName.componentsSeparatedByString(".")
open func loadConfig(_ fileName: String) {
var components = fileName.components(separatedBy: ".")
let type = components.popLast()
let name = components.joinWithSeparator(".")
if let path = NSBundle.mainBundle().pathForResource(name, ofType: type) {
let name = components.joined(separator: ".")
if let path = Bundle.main.path(forResource: name, ofType: type) {
let configDict = NSDictionary(contentsOfFile: path) as! [String: AnyObject]
loadConfig(configDict)
}
}
public func loadConfig(dictionary: [String: AnyObject]) {
open func loadConfig(_ dictionary: [String: AnyObject]) {
if let lifeCycleDict = dictionary[ConfigKey.lifeCycle] as? [String: AnyObject] {
loadLifeCycleConfig(lifeCycleDict)
}
@@ -55,7 +55,7 @@ public class AppConfig {
}
}
func loadLifeCycleConfig(dictionary: [String: AnyObject]) {
func loadLifeCycleConfig(_ dictionary: [String: AnyObject]) {
for (key, value) in dictionary {
var items = [AppLifeCycleItem]()
if let itemArray = value as? [AnyObject] {
@@ -65,7 +65,7 @@ public class AppConfig {
}
}
func loadCustomConfig(dictionary: [String: AnyObject]) {
func loadCustomConfig(_ dictionary: [String: AnyObject]) {
customConfig = dictionary
}
@@ -8,17 +8,17 @@
import UIKit
public class AppDelegate: UIResponder, UIApplicationDelegate {
open class AppDelegate: UIResponder, UIApplicationDelegate {
public var bootstrapViewController: UIViewController {
open var bootstrapViewController: UIViewController {
return UIViewController()
}
public var window: UIWindow?
open var window: UIWindow?
public func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
open func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window?.backgroundColor = UIColor.whiteColor()
window = UIWindow(frame: UIScreen.main.bounds)
window?.backgroundColor = UIColor.white
window?.makeKeyAndVisible()
appConfig.loadConfig("config.plist")
if let lifeCycleItems = appConfig.lifeCycleConfig[LifeCycleKey.didFinishLaunchingWithOptions] {
@@ -29,12 +29,12 @@ public class AppDelegate: UIResponder, UIApplicationDelegate {
return true
}
public func applicationWillResignActive(application: UIApplication) {
open func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
public func applicationDidEnterBackground(application: UIApplication) {
open func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
if let lifeCycleItems = appConfig.lifeCycleConfig[LifeCycleKey.didEnterBackground] {
@@ -44,7 +44,7 @@ public class AppDelegate: UIResponder, UIApplicationDelegate {
}
}
public func applicationWillEnterForeground(application: UIApplication) {
open func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
if let lifeCycleItems = appConfig.lifeCycleConfig[LifeCycleKey.willEnterForeground] {
for item in lifeCycleItems{
@@ -53,7 +53,7 @@ public class AppDelegate: UIResponder, UIApplicationDelegate {
}
}
public func applicationDidBecomeActive(application: UIApplication) {
open func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
if let lifeCycleItems = appConfig.lifeCycleConfig[LifeCycleKey.didBecomeActive] {
for item in lifeCycleItems{
@@ -62,7 +62,7 @@ public class AppDelegate: UIResponder, UIApplicationDelegate {
}
}
public func applicationWillTerminate(application: UIApplication) {
open func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
if let lifeCycleItems = appConfig.lifeCycleConfig[LifeCycleKey.willTerminate] {
for item in lifeCycleItems{
@@ -71,36 +71,36 @@ public class AppDelegate: UIResponder, UIApplicationDelegate {
}
}
public func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
open func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
if let lifeCycleItems = appConfig.lifeCycleConfig[LifeCycleKey.remoteNotification] {
for item in lifeCycleItems{
item.object?.application?(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
}
}
}
public func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) {
open func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
if let lifeCycleItems = appConfig.lifeCycleConfig[LifeCycleKey.remoteNotification] {
for item in lifeCycleItems{
item.object?.application?(application, didFailToRegisterForRemoteNotificationsWithError: error)
}
}
}
public func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
open func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
if let lifeCycleItems = appConfig.lifeCycleConfig[LifeCycleKey.remoteNotification] {
for item in lifeCycleItems{
item.object?.application?(application, didReceiveRemoteNotification: userInfo, fetchCompletionHandler: completionHandler)
}
}
}
public func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
open func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
var handled = false
if let lifeCycleItems = appConfig.lifeCycleConfig[LifeCycleKey.openURL] {
for item in lifeCycleItems{
if #available(iOSApplicationExtension 9.0, *) {
if let res = item.object?.application?(app, openURL: url, options: options) where res{
if let res = item.object?.application?(app, open: url, options: options), res{
handled = res
}
} else {
@@ -13,27 +13,27 @@ public struct AppEnv {
// App Version
// App Build
public static var version: String {
return NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleShortVersionString") as! String
return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String
}
public static var fullVersion: String {
return "\(AppEnv.version) Build \(AppEnv.build)"
}
public static var build: String {
return NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleVersion") as! String
return Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as! String
}
public static var countryCode: String {
return NSLocale.currentLocale().objectForKey(NSLocaleCountryCode) as? String ?? "US"
return (Locale.current as NSLocale).object(forKey: NSLocale.Key.countryCode) as? String ?? "US"
}
public static var languageCode: String {
return NSLocale.currentLocale().objectForKey(NSLocaleLanguageCode) as? String ?? "en"
return (Locale.current as NSLocale).object(forKey: NSLocale.Key.languageCode) as? String ?? "en"
}
public static var appName: String {
return NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleDisplayName") as! String
return Bundle.main.object(forInfoDictionaryKey: "CFBundleDisplayName") as! String
}
public static var isTestFlight: Bool {
@@ -47,16 +47,16 @@ public struct AppEnv {
return true
}
private static var isAppStoreReceiptSandbox: Bool {
let b = NSBundle.mainBundle().appStoreReceiptURL?.lastPathComponent == "sandboxReceipt"
fileprivate static var isAppStoreReceiptSandbox: Bool {
let b = Bundle.main.appStoreReceiptURL?.lastPathComponent == "sandboxReceipt"
NSLog("isAppStoreReceiptSandbox: \(b)")
return b
}
private static var hasEmbeddedMobileProvision: Bool {
let b = NSBundle.mainBundle().pathForResource("embedded", ofType: "mobileprovision") != nil
fileprivate static var hasEmbeddedMobileProvision: Bool {
let b = Bundle.main.path(forResource: "embedded", ofType: "mobileprovision") != nil
NSLog("hasEmbeddedMobileProvision: \(b)")
return b
}
}
}
@@ -1885,7 +1885,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = ShadowPathDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.touchingapp.ShadowPathDemo;
PRODUCT_BUNDLE_IDENTIFIER = io.wasin.ShadowPathDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
USER_HEADER_SEARCH_PATHS = "";
};
@@ -1897,7 +1897,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = ShadowPathDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.touchingapp.ShadowPathDemo;
PRODUCT_BUNDLE_IDENTIFIER = io.wasin.ShadowPathDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
USER_HEADER_SEARCH_PATHS = "";
};
@@ -2023,7 +2023,7 @@
"-DUDPRELAY_LOCAL",
"-DMODULE_LOCAL",
);
PRODUCT_BUNDLE_IDENTIFIER = com.touchingapp.ShadowPath;
PRODUCT_BUNDLE_IDENTIFIER = io.wasin.ShadowPath;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "";
@@ -2059,7 +2059,7 @@
"-DUDPRELAY_LOCAL",
"-DMODULE_LOCAL",
);
PRODUCT_BUNDLE_IDENTIFIER = com.touchingapp.ShadowPath;
PRODUCT_BUNDLE_IDENTIFIER = io.wasin.ShadowPath;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "";
@@ -16,7 +16,7 @@
#import "tun2socks/tun2socks.h"
@import CocoaAsyncSocket;
#define kTunnelInterfaceErrorDomain @"com.touchingapp.potatso.TunnelInterface"
#define kTunnelInterfaceErrorDomain @"io.wasin.potatso.TunnelInterface"
@interface TunnelInterface () <GCDAsyncUdpSocketDelegate>
@property (nonatomic) NEPacketTunnelFlow *tunnelPacketFlow;
@@ -41,7 +41,7 @@ struct _BTime_global btime_global = {
#include <mach/clock.h>
#include <mach/mach.h>
int clock_gettime(int clk_id, struct timespec* t)
/*int clock_gettime(int clk_id, struct timespec* t)
{
clock_serv_t cclock;
mach_timespec_t mts;
@@ -51,5 +51,5 @@ int clock_gettime(int clk_id, struct timespec* t)
t->tv_sec = mts.tv_sec;
t->tv_nsec = mts.tv_nsec;
return 0;
}
}*/
#endif
@@ -71,7 +71,7 @@ struct _BTime_global {
#ifdef __MACH__
#define CLOCK_MONOTONIC 1
int clock_gettime(int clk_id, struct timespec* t);
//int clock_gettime(int clk_id, struct timespec* t);
#endif
extern struct _BTime_global btime_global;
View
@@ -18,8 +18,6 @@
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.4.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>121</string>
<key>Fabric</key>
@@ -48,5 +46,9 @@
<key>NSExtensionPrincipalClass</key>
<string>PacketTunnelProvider</string>
</dict>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>gamekit</string>
</array>
</dict>
</plist>
@@ -2,15 +2,13 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.networking.networkextension</key>
<key>com.apple.security.application-groups</key>
<array>
<string>packet-tunnel-provider</string>
<string>app-proxy-provider</string>
<string>content-filter-provider</string>
<string>group.io.wasin.potatso</string>
</array>
<key>com.apple.security.application-groups</key>
<key>keychain-access-groups</key>
<array>
<string>group.com.touchingapp.potatso</string>
<string>$(AppIdentifierPrefix)io.wasin.potatso.tunnel</string>
</array>
</dict>
</plist>
@@ -57,7 +57,7 @@ - (void)updateUserDefaults {
}
- (void)setupWormhole {
self.wormhole = [[MMWormhole alloc] initWithApplicationGroupIdentifier:@"group.com.touchingapp.potatso" optionalDirectory:@"wormhole"];
self.wormhole = [[MMWormhole alloc] initWithApplicationGroupIdentifier:@"group.io.wasin.potatso" optionalDirectory:@"wormhole"];
__weak typeof(self) weakSelf = self;
[self.wormhole listenForMessageWithIdentifier:@"getTunnelStatus" listener:^(id _Nullable messageObject) {
[weakSelf.wormhole passMessageObject:@"ok" identifier:@"tunnelStatus"];
@@ -78,7 +78,7 @@ - (void)onSocksProxyCallback:(int)fd {
self.socksProxyPort = sock_port(fd);
self.socksProxyRunning = YES;
}else {
error = [NSError errorWithDomain:@"com.touchingapp.potatso" code:100 userInfo:@{NSLocalizedDescriptionKey: @"Fail to start socks proxy"}];
error = [NSError errorWithDomain:@"io.wasin.potatso" code:100 userInfo:@{NSLocalizedDescriptionKey: @"Fail to start socks proxy"}];
}
if (self.socksCompletion) {
self.socksCompletion(self.socksProxyPort, error);
@@ -142,7 +142,7 @@ - (void)onShadowsocksCallback:(int)fd {
self.shadowsocksProxyPort = sock_port(fd);
self.shadowsocksProxyRunning = YES;
}else {
error = [NSError errorWithDomain:@"com.touchingapp.potatso" code:100 userInfo:@{NSLocalizedDescriptionKey: @"Fail to start http proxy"}];
error = [NSError errorWithDomain:@"io.wasin.potatso" code:100 userInfo:@{NSLocalizedDescriptionKey: @"Fail to start http proxy"}];
}
if (self.shadowsocksCompletion) {
self.shadowsocksCompletion(self.shadowsocksProxyPort, error);
@@ -179,7 +179,7 @@ - (void)onHttpProxyCallback:(int)fd {
self.httpProxyPort = sock_port(fd);
self.httpProxyRunning = YES;
}else {
error = [NSError errorWithDomain:@"com.touchingapp.potatso" code:100 userInfo:@{NSLocalizedDescriptionKey: @"Fail to start http proxy"}];
error = [NSError errorWithDomain:@"io.wasin.potatso" code:100 userInfo:@{NSLocalizedDescriptionKey: @"Fail to start http proxy"}];
}
if (self.httpCompletion) {
self.httpCompletion(self.httpProxyPort, error);
Oops, something went wrong.

0 comments on commit c61c515

Please sign in to comment.