Skip to content

Commit bce96bf

Browse files
Remove CPAProxy
1 parent 0649e80 commit bce96bf

File tree

8 files changed

+26
-40
lines changed

8 files changed

+26
-40
lines changed

ChatSecure.xcodeproj/project.pbxproj

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,6 @@
437437
D9C52B3C235CB582002B213A /* OTRXMPPServerInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = D9C529AE235CB580002B213A /* OTRXMPPServerInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
438438
D9C52B3D235CB582002B213A /* ChatSecureCoreCompat-Swift.h in Headers */ = {isa = PBXBuildFile; fileRef = D9C529B0235CB580002B213A /* ChatSecureCoreCompat-Swift.h */; };
439439
D9C52B3F235CBC27002B213A /* ChatSecureCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D9C52800235CB55C002B213A /* ChatSecureCore.framework */; };
440-
D9D02B452409C81300D477F1 /* CPAProxy.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D90DA4F3236F3C6800C585B7 /* CPAProxy.bundle */; };
441440
D9DEC34A1FABC9F900BF1F7C /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D9DEC3491FABC9F900BF1F7C /* Settings.bundle */; };
442441
D9ECD08F2344626800ECE5F9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D9ECD08E2344626800ECE5F9 /* LaunchScreen.storyboard */; };
443442
D9F5C2A8236F7F8200F14A16 /* Purchase.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D93EFA8D235971E2007474EC /* Purchase.storyboard */; };
@@ -550,13 +549,6 @@
550549
remoteGlobalIDString = D9C527FF235CB55C002B213A;
551550
remoteInfo = ChatSecureCore;
552551
};
553-
D9D02B3F2409C80600D477F1 /* PBXContainerItemProxy */ = {
554-
isa = PBXContainerItemProxy;
555-
containerPortal = D9B7EEDF235D476700AD1EEA /* CPAProxy.xcodeproj */;
556-
proxyType = 1;
557-
remoteGlobalIDString = D97947C3235D0005000D86AE;
558-
remoteInfo = "CPAProxy.bundle (iOS)";
559-
};
560552
/* End PBXContainerItemProxy section */
561553

562554
/* Begin PBXFileReference section */
@@ -2161,7 +2153,6 @@
21612153
buildRules = (
21622154
);
21632155
dependencies = (
2164-
D9D02B402409C80600D477F1 /* PBXTargetDependency */,
21652156
D9C52806235CB55C002B213A /* PBXTargetDependency */,
21662157
);
21672158
name = ChatSecure;
@@ -2382,7 +2373,6 @@
23822373
isa = PBXResourcesBuildPhase;
23832374
buildActionMask = 2147483647;
23842375
files = (
2385-
D9D02B452409C81300D477F1 /* CPAProxy.bundle in Resources */,
23862376
D9F5C2A9236F7F8200F14A16 /* OMEMODeviceFingerprintCell.xib in Resources */,
23872377
D9F5C2C3236F7FA700F14A16 /* OTRComposeGroup.storyboard in Resources */,
23882378
635EF2021E276C410087BD72 /* Localizable.strings in Resources */,
@@ -2895,11 +2885,6 @@
28952885
target = D9C527FF235CB55C002B213A /* ChatSecureCore */;
28962886
targetProxy = D9C52B40235CBC3A002B213A /* PBXContainerItemProxy */;
28972887
};
2898-
D9D02B402409C80600D477F1 /* PBXTargetDependency */ = {
2899-
isa = PBXTargetDependency;
2900-
name = "CPAProxy.bundle (iOS)";
2901-
targetProxy = D9D02B3F2409C80600D477F1 /* PBXContainerItemProxy */;
2902-
};
29032888
/* End PBXTargetDependency section */
29042889

29052890
/* Begin PBXVariantGroup section */
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
EXPORT_COMPLIANCE_CODE=240f0a63-ba8b-40ff-bfce-20848ef174d0
1+
EXPORT_COMPLIANCE_CODE=da55f6b4-d796-422f-9566-c5188326ac49
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
EXPORT_COMPLIANCE_CODE=240f0a63-ba8b-40ff-bfce-20848ef174d0
1+
EXPORT_COMPLIANCE_CODE=da55f6b4-d796-422f-9566-c5188326ac49

ChatSecureCore.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ TODO: Add long description of the pod here.
4949
s.dependency 'CocoaAsyncSocket', '~> 7.6.0'
5050
s.dependency 'ProxyKit/Client', '~> 1.2.0'
5151
s.dependency 'GCDWebServer', '~> 3.4'
52-
s.dependency 'CPAProxy'
52+
# s.dependency 'CPAProxy'
5353
s.dependency 'XMPPFramework/Swift'
5454

5555
s.dependency 'ChatSecure-Push-iOS'

ChatSecureCore/Classes/Controllers/OTRTorManager.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
@import Foundation;
1010
@class CPAProxyManager;
1111

12+
NS_ASSUME_NONNULL_BEGIN
1213
@interface OTRTorManager : NSObject
1314

14-
@property (nonatomic, strong) CPAProxyManager *torManager;
15+
@property (nonatomic, strong, nullable) CPAProxyManager *torManager;
1516

1617
+ (instancetype) sharedInstance;
1718

1819
@end
20+
NS_ASSUME_NONNULL_END

ChatSecureCore/Classes/Controllers/OTRTorManager.m

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
#import "OTRTorManager.h"
10+
#import "OTRLog.h"
1011

1112
@import CPAProxy;
1213

@@ -17,18 +18,22 @@ - (instancetype) init {
1718
// Get resource paths for the torrc and geoip files from the main bundle
1819
NSBundle *cpaProxyFrameworkBundle = [NSBundle bundleForClass:[CPAProxyManager class]];
1920
NSURL *cpaProxyBundleURL = [cpaProxyFrameworkBundle URLForResource:@"CPAProxy" withExtension:@"bundle"];
20-
NSBundle *cpaProxyBundle = [[NSBundle alloc] initWithURL:cpaProxyBundleURL];
21-
NSParameterAssert(cpaProxyBundle != nil);
22-
23-
NSString *torrcPath = [[NSBundle mainBundle] pathForResource:@"torrc" ofType:nil]; // use custom torrc
24-
NSString *geoipPath = [cpaProxyBundle pathForResource:@"geoip" ofType:nil];
25-
NSString *dataDirectory = [[[[[NSFileManager defaultManager] URLsForDirectory:NSApplicationSupportDirectory inDomains:NSUserDomainMask] lastObject] URLByAppendingPathComponent:@"com.ChatSecure.Tor"] path];
26-
27-
// Initialize a CPAProxyManager
28-
CPAConfiguration *configuration = [CPAConfiguration configurationWithTorrcPath:torrcPath geoipPath:geoipPath torDataDirectoryPath:dataDirectory];
29-
configuration.isolateDestinationAddress = YES;
30-
configuration.isolateDestinationPort = YES;
31-
self.torManager = [CPAProxyManager proxyWithConfiguration:configuration];
21+
if (cpaProxyBundleURL) {
22+
NSBundle *cpaProxyBundle = [[NSBundle alloc] initWithURL:cpaProxyBundleURL];
23+
NSParameterAssert(cpaProxyBundle != nil);
24+
25+
NSString *torrcPath = [[NSBundle mainBundle] pathForResource:@"torrc" ofType:nil]; // use custom torrc
26+
NSString *geoipPath = [cpaProxyBundle pathForResource:@"geoip" ofType:nil];
27+
NSString *dataDirectory = [[[[[NSFileManager defaultManager] URLsForDirectory:NSApplicationSupportDirectory inDomains:NSUserDomainMask] lastObject] URLByAppendingPathComponent:@"com.ChatSecure.Tor"] path];
28+
29+
// Initialize a CPAProxyManager
30+
CPAConfiguration *configuration = [CPAConfiguration configurationWithTorrcPath:torrcPath geoipPath:geoipPath torDataDirectoryPath:dataDirectory];
31+
configuration.isolateDestinationAddress = YES;
32+
configuration.isolateDestinationPort = YES;
33+
self.torManager = [CPAProxyManager proxyWithConfiguration:configuration];
34+
} else {
35+
DDLogError(@"Could not initialize CPAProxy, missing bundle!");
36+
}
3237
}
3338
return self;
3439
}

Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ abstract_target 'ChatSecureCorePods' do
2727
pod 'LumberjackConsole', :path => 'Submodules/LumberjackConsole/LumberjackConsole.podspec'
2828

2929
# Network
30-
pod 'CPAProxy', :path => 'Submodules/CPAProxy/CPAProxy.podspec'
30+
# pod 'CPAProxy', :path => 'Submodules/CPAProxy/CPAProxy.podspec'
3131
pod 'XMPPFramework/Swift', :path => 'Submodules/XMPPFramework/XMPPFramework.podspec'
3232

3333
pod 'ChatSecure-Push-iOS', :path => 'Submodules/ChatSecure-Push-iOS/ChatSecure-Push-iOS.podspec'

Podfile.lock

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ PODS:
2121
- ChatSecure-Push-iOS
2222
- CocoaAsyncSocket (~> 7.6.0)
2323
- CocoaLumberjack/Swift (~> 3.6.0)
24-
- CPAProxy
2524
- FormatterKit/TimeIntervalFormatter (~> 1.8)
2625
- FormatterKit/UnitOfInformationFormatter (~> 1.8)
2726
- GCDWebServer (~> 3.4)
@@ -59,7 +58,6 @@ PODS:
5958
- CocoaLumberjack/Core (3.6.1)
6059
- CocoaLumberjack/Swift (3.6.1):
6160
- CocoaLumberjack/Core
62-
- CPAProxy (2.0.0)
6361
- DTFoundation/Core (1.7.14)
6462
- DTFoundation/DTASN1 (1.7.14):
6563
- DTFoundation/Core
@@ -261,7 +259,6 @@ PODS:
261259
DEPENDENCIES:
262260
- ChatSecure-Push-iOS (from `Submodules/ChatSecure-Push-iOS/ChatSecure-Push-iOS.podspec`)
263261
- ChatSecureCore (from `ChatSecureCore.podspec`)
264-
- CPAProxy (from `Submodules/CPAProxy/CPAProxy.podspec`)
265262
- IOCipher/GCDWebServer (from `Submodules/IOCipher/IOCipher.podspec`)
266263
- JSQMessagesViewController (from `Submodules/JSQMessagesViewController/JSQMessagesViewController.podspec`)
267264
- libsqlfs/SQLCipher (from `Submodules/libsqlfs/libsqlfs.podspec`)
@@ -313,8 +310,6 @@ EXTERNAL SOURCES:
313310
:path: Submodules/ChatSecure-Push-iOS/ChatSecure-Push-iOS.podspec
314311
ChatSecureCore:
315312
:path: ChatSecureCore.podspec
316-
CPAProxy:
317-
:path: Submodules/CPAProxy/CPAProxy.podspec
318313
IOCipher:
319314
:path: Submodules/IOCipher/IOCipher.podspec
320315
JSQMessagesViewController:
@@ -363,10 +358,9 @@ SPEC CHECKSUMS:
363358
BBlock: c56d7f72597ffe1634fcdc73836c5c0fed3271be
364359
BButton: ab0f2ed3b998ae73c5188b57d270d81e4a1eeb27
365360
ChatSecure-Push-iOS: b1e7f4133afb77a42464aa0be96b14e03edcef29
366-
ChatSecureCore: 456b430f63e96e38e01a59879162885b4f93601d
361+
ChatSecureCore: d29dc259e8b44c9020d06a41789ea017a8c351b8
367362
CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845
368363
CocoaLumberjack: b17ae15142558d08bbacf69775fa10c4abbebcc9
369-
CPAProxy: fdb5600a16502e7c8176ab59e7e9c306fbe5dc59
370364
DTFoundation: 25aa19bb7c6e225b1dfae195604fb8cf1da0ab4c
371365
FormatterKit: 184db51bf120b633693a73624a4cede89ec51a41
372366
GCDWebServer: 2c156a56c8226e2d5c0c3f208a3621ccffbe3ce4
@@ -403,6 +397,6 @@ SPEC CHECKSUMS:
403397
YapTaskQueue: 390669f5ef248a515e2a0d955de9d2529e2c7fa5
404398
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb
405399

406-
PODFILE CHECKSUM: 7e1a4a7ce290bdb09d8e2b614ba8be6a8a949468
400+
PODFILE CHECKSUM: e559e1c4d42575a15d20d7bebae903eb2b3fb2a2
407401

408402
COCOAPODS: 1.9.1

0 commit comments

Comments
 (0)