diff --git a/Podfile b/Podfile index 7594c228..c0986dbf 100644 --- a/Podfile +++ b/Podfile @@ -3,7 +3,12 @@ use_frameworks! inhibit_all_warnings! target 'ooniprobe' do - pod "oonimkall", :podspec => "https://github.com/ooni/probe-cli/releases/download/v3.18.1/oonimkall.podspec" + pod "libcrypto", :podspec => "https://github.com/ooni/probe-cli/releases/download/v3.19.0/libcrypto.podspec" + pod "libevent", :podspec => "https://github.com/ooni/probe-cli/releases/download/v3.19.0/libevent.podspec" + pod "libssl", :podspec => "https://github.com/ooni/probe-cli/releases/download/v3.19.0/libssl.podspec" + pod "libtor", :podspec => "https://github.com/ooni/probe-cli/releases/download/v3.19.0/libtor.podspec" + pod "libz", :podspec => "https://github.com/ooni/probe-cli/releases/download/v3.19.0/libz.podspec" + pod "oonimkall", :podspec => "https://github.com/ooni/probe-cli/releases/download/v3.19.0/oonimkall.podspec" pod 'Toast', '~> 4.0.0' pod 'MBProgressHUD' pod 'DZNEmptyDataSet' @@ -19,7 +24,12 @@ target 'ooniprobe' do end target 'OONIProbeUnitTests' do - pod "oonimkall", :podspec => "https://github.com/ooni/probe-cli/releases/download/v3.18.1/oonimkall.podspec" + pod "libcrypto", :podspec => "https://github.com/ooni/probe-cli/releases/download/v3.19.0/libcrypto.podspec" + pod "libevent", :podspec => "https://github.com/ooni/probe-cli/releases/download/v3.19.0/libevent.podspec" + pod "libssl", :podspec => "https://github.com/ooni/probe-cli/releases/download/v3.19.0/libssl.podspec" + pod "libtor", :podspec => "https://github.com/ooni/probe-cli/releases/download/v3.19.0/libtor.podspec" + pod "libz", :podspec => "https://github.com/ooni/probe-cli/releases/download/v3.19.0/libz.podspec" + pod "oonimkall", :podspec => "https://github.com/ooni/probe-cli/releases/download/v3.19.0/oonimkall.podspec" pod 'SharkORM', :git => 'https://github.com/sharksync/sharkorm', :tag => 'v2.3.67' pod 'OCMapper', '2.0' end @@ -28,7 +38,7 @@ post_install do |installer| installer.generated_projects.each do |project| project.targets.each do |target| target.build_configurations.each do |config| - config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0' + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' end end end diff --git a/Podfile.lock b/Podfile.lock index 2030b23a..0609eb37 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -5,11 +5,16 @@ PODS: - DateTools (2.0.0) - DZNEmptyDataSet (1.8.1) - Harpy (4.1.14) + - libcrypto (2023.10.20-093053) + - libevent (2023.10.20-093053) + - libssl (2023.10.20-093053) + - libtor (2023.10.20-093053) + - libz (2023.10.20-093053) - lottie-ios (2.5.3) - MBProgressHUD (1.2.0) - MKDropdownMenu (1.4) - OCMapper (2.0) - - oonimkall (2023.07.18-162800) + - oonimkall (2023.10.20-093053) - RHMarkdownLabel (0.0.1): - TTTAttributedLabel - XNGMarkdownParser @@ -26,11 +31,16 @@ DEPENDENCIES: - DateTools - DZNEmptyDataSet - Harpy + - libcrypto (from `https://github.com/ooni/probe-cli/releases/download/v3.19.0/libcrypto.podspec`) + - libevent (from `https://github.com/ooni/probe-cli/releases/download/v3.19.0/libevent.podspec`) + - libssl (from `https://github.com/ooni/probe-cli/releases/download/v3.19.0/libssl.podspec`) + - libtor (from `https://github.com/ooni/probe-cli/releases/download/v3.19.0/libtor.podspec`) + - libz (from `https://github.com/ooni/probe-cli/releases/download/v3.19.0/libz.podspec`) - lottie-ios (= 2.5.3) - MBProgressHUD - MKDropdownMenu - OCMapper (= 2.0) - - oonimkall (from `https://github.com/ooni/probe-cli/releases/download/v3.18.1/oonimkall.podspec`) + - oonimkall (from `https://github.com/ooni/probe-cli/releases/download/v3.19.0/oonimkall.podspec`) - RHMarkdownLabel - Sentry (from `https://github.com/getsentry/sentry-cocoa.git`, tag `6.1.4`) - SharkORM (from `https://github.com/sharksync/sharkorm`, tag `v2.3.67`) @@ -52,8 +62,18 @@ SPEC REPOS: - XNGMarkdownParser EXTERNAL SOURCES: + libcrypto: + :podspec: https://github.com/ooni/probe-cli/releases/download/v3.19.0/libcrypto.podspec + libevent: + :podspec: https://github.com/ooni/probe-cli/releases/download/v3.19.0/libevent.podspec + libssl: + :podspec: https://github.com/ooni/probe-cli/releases/download/v3.19.0/libssl.podspec + libtor: + :podspec: https://github.com/ooni/probe-cli/releases/download/v3.19.0/libtor.podspec + libz: + :podspec: https://github.com/ooni/probe-cli/releases/download/v3.19.0/libz.podspec oonimkall: - :podspec: https://github.com/ooni/probe-cli/releases/download/v3.18.1/oonimkall.podspec + :podspec: https://github.com/ooni/probe-cli/releases/download/v3.19.0/oonimkall.podspec Sentry: :git: https://github.com/getsentry/sentry-cocoa.git :tag: 6.1.4 @@ -74,11 +94,16 @@ SPEC CHECKSUMS: DateTools: 933ac9c490f21f92127cf690ccd8c397e0126caf DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7 Harpy: b2fbe6819f6a8932df32d7cd2fb20f442df86bbc + libcrypto: 7ca9f969d54aac0eebf5263b2b8c3fd97908bc64 + libevent: e4bab8744d4d57090e69ac6235fdf4714909d2ad + libssl: eaba80b0e1eea4250828e71655b99ede4ac4368b + libtor: ae56e6fcc080a2c030c8b583cf06037872edd62f + libz: 057607e787b238fee3a922d3bf52ab3fd7b7c443 lottie-ios: a50d5c0160425cd4b01b852bb9578963e6d92d31 MBProgressHUD: 3ee5efcc380f6a79a7cc9b363dd669c5e1ae7406 MKDropdownMenu: 269df4a41d21a1db684ce8bc709befe419fc5bae OCMapper: 9b4d542543794c42adc01f1493d894f53e193cb0 - oonimkall: 7765766adbf7284e866fee5590acf55b1b76995e + oonimkall: 63533c51420ad15121fd18800ed82639b6e813fa RHMarkdownLabel: 81d6772768e621be57302b7fd5212ad4f78fb0bd Sentry: 9d055e2de30a77685e86b219acf02e59b82091fc SharkORM: 252e4411923110ac1b524a993ee2b3fa13eed7c4 @@ -86,6 +111,6 @@ SPEC CHECKSUMS: TTTAttributedLabel: 8cffe8e127e4e82ff3af1e5386d4cd0ad000b656 XNGMarkdownParser: aed98c14f0c0eb20064184ddf9bac26c482722b2 -PODFILE CHECKSUM: e82378591e42a948797afaec35b1efccdb5765ac +PODFILE CHECKSUM: cee8da05f005fec950d2db112132f04f0ba3adc9 COCOAPODS: 1.13.0 diff --git a/ooniprobe.xcodeproj/project.pbxproj b/ooniprobe.xcodeproj/project.pbxproj index 468cf241..af4f09d2 100644 --- a/ooniprobe.xcodeproj/project.pbxproj +++ b/ooniprobe.xcodeproj/project.pbxproj @@ -224,6 +224,11 @@ 7940AA8F28117E9000C0EB5D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 7940AA972811840900C0EB5D /* share.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = share.entitlements; sourceTree = ""; }; 79780FCE27E9F18E002A38B1 /* Languages.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Languages.plist; sourceTree = ""; }; + 7A8CB0932ADDDAC1005AB2BC /* libcrypto.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libcrypto.xcframework; path = Pods/libcrypto/libcrypto.xcframework; sourceTree = ""; }; + 7A8CB0942ADDDAC1005AB2BC /* libevent.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libevent.xcframework; path = Pods/libevent/libevent.xcframework; sourceTree = ""; }; + 7A8CB0952ADDDAC1005AB2BC /* libssl.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libssl.xcframework; path = Pods/libssl/libssl.xcframework; sourceTree = ""; }; + 7A8CB0962ADDDAC1005AB2BC /* libtor.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libtor.xcframework; path = Pods/libtor/libtor.xcframework; sourceTree = ""; }; + 7A8CB0972ADDDAC1005AB2BC /* libz.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libz.xcframework; path = Pods/libz/libz.xcframework; sourceTree = ""; }; 79AA093C2A86E44400C23E27 /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = vi.lproj/Localizable.strings; sourceTree = ""; }; 79AA093D2A86E47600C23E27 /* my */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = my; path = my.lproj/Localizable.strings; sourceTree = ""; }; 7AED19802A6EC9A2003B265A /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; }; @@ -1151,6 +1156,11 @@ F4F15431D4412F561191270F /* Frameworks */ = { isa = PBXGroup; children = ( + 7A8CB0932ADDDAC1005AB2BC /* libcrypto.xcframework */, + 7A8CB0942ADDDAC1005AB2BC /* libevent.xcframework */, + 7A8CB0952ADDDAC1005AB2BC /* libssl.xcframework */, + 7A8CB0962ADDDAC1005AB2BC /* libtor.xcframework */, + 7A8CB0972ADDDAC1005AB2BC /* libz.xcframework */, 7AED19802A6EC9A2003B265A /* libresolv.tbd */, 7AED19822A6EC9C7003B265A /* libresolv.tbd */, ED3582311FE948580078CCEE /* libsqlite3.tbd */, @@ -2022,7 +2032,7 @@ IBC_WARNINGS = NO; IBSC_WARNINGS = NO; INFOPLIST_FILE = ooniprobe/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited)"; LIBRARY_SEARCH_PATHS = "$(inherited)"; MARKETING_VERSION = 3.8.3; @@ -2072,7 +2082,7 @@ IBC_WARNINGS = NO; IBSC_WARNINGS = NO; INFOPLIST_FILE = ooniprobe/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited)"; LIBRARY_SEARCH_PATHS = "$(inherited)"; MARKETING_VERSION = 3.8.3; diff --git a/ooniprobe/Test/Suite/ExperimentalSuite.m b/ooniprobe/Test/Suite/ExperimentalSuite.m index f4af054e..bb2d594e 100644 --- a/ooniprobe/Test/Suite/ExperimentalSuite.m +++ b/ooniprobe/Test/Suite/ExperimentalSuite.m @@ -14,12 +14,13 @@ - (id)init { - (NSArray *)getTestList { if ([self.testList count] == 0) { if ([SettingsUtility isExperimentalTestEnabled]) { + [self.testList addObject:[[Experimental alloc] initWithName:@"stunreachability"]]; + [self.testList addObject:[[Experimental alloc] initWithName:@"dnscheck"]]; + [self.testList addObject:[[Experimental alloc] initWithName:@"echcheck"]]; if ([SettingsUtility isLongRunningTestsInForegroundEnabled] || self.autoRun) { [self.testList addObject:[[Experimental alloc] initWithName:@"torsf"]]; [self.testList addObject:[[Experimental alloc] initWithName:@"vanilla_tor"]]; } - [self.testList addObject:[[Experimental alloc] initWithName:@"stunreachability"]]; - [self.testList addObject:[[Experimental alloc] initWithName:@"dnscheck"]]; } } return super.getTestList; diff --git a/ooniprobe/Test/Test/AbstractTest.m b/ooniprobe/Test/Test/AbstractTest.m index f2010ff6..5436cfb6 100644 --- a/ooniprobe/Test/Test/AbstractTest.m +++ b/ooniprobe/Test/Test/AbstractTest.m @@ -183,7 +183,11 @@ -(void)runTest{ } else if ([event.key isEqualToString:@"failure.startup"] || [event.key isEqualToString:@"failure.resolver_lookup"]) { - [self.result setFailure_msg:event.value.failure]; + if([self.result failure_msg] == nil){ + [self.result setFailure_msg:event.value.failure]; + } else { + [self.result setFailure_msg:[NSString stringWithFormat:@"%@\n\n%@", [self.result failure_msg], event.value.failure]]; + } [self.result save]; [ThirdPartyServices recordError:@"failure" reason:event.key diff --git a/ooniprobe/Utility/LocalizationUtility.m b/ooniprobe/Utility/LocalizationUtility.m index e6ec4c09..9b797d71 100644 --- a/ooniprobe/Utility/LocalizationUtility.m +++ b/ooniprobe/Utility/LocalizationUtility.m @@ -63,7 +63,8 @@ + (NSString*)getLongDescriptionForTest:(NSString*)testName{ return NSLocalizedFormatString(@"Dashboard.Experimental.Overview.Paragraph", [NSString stringWithFormat:@"%@ %@ %@", @"\n\n- [STUN Reachability](https://github.com/ooni/spec/blob/master/nettests/ts-025-stun-reachability.md) " - "\n\n- [DNS Check](https://github.com/ooni/spec/blob/master/nettests/ts-028-dnscheck.md) ", + "\n\n- [DNS Check](https://github.com/ooni/spec/blob/master/nettests/ts-028-dnscheck.md) " + "\n\n- [ECH Check](https://github.com/ooni/spec/blob/master/nettests/ts-039-echcheck.md)", [NSString stringWithFormat:@"%@ ( %@ )", @"\n\n- [Tor Snowflake](https://ooni.org/nettest/tor-snowflake/) ",NSLocalizedFormatString(@"Settings.TestOptions.LongRunningTest",nil)], [NSString stringWithFormat:@"%@ ( %@ )", @"\n\n- [Vanilla Tor](https://github.com/ooni/spec/blob/master/nettests/ts-016-vanilla-tor.md) ",NSLocalizedFormatString(@"Settings.TestOptions.LongRunningTest",nil)] ]); diff --git a/ooniprobe/Utility/ProxySettings.h b/ooniprobe/Utility/ProxySettings.h index d3bfcd59..5f62d7d5 100644 --- a/ooniprobe/Utility/ProxySettings.h +++ b/ooniprobe/Utility/ProxySettings.h @@ -3,7 +3,9 @@ typedef NS_ENUM(NSInteger, ProxyProtocol) { NONE, PSIPHON, - SOCKS5 + SOCKS5, + HTTP, + HTTPS }; @interface ProxySettings : NSObject diff --git a/ooniprobe/Utility/ProxySettings.m b/ooniprobe/Utility/ProxySettings.m index 876732a8..f39d9705 100644 --- a/ooniprobe/Utility/ProxySettings.m +++ b/ooniprobe/Utility/ProxySettings.m @@ -12,6 +12,10 @@ - (id) init { self.protocol = PSIPHON; } else if ([protocol isEqualToString:[ProxySettings getProtocol:SOCKS5]]) { self.protocol = SOCKS5; + } else if ([protocol isEqualToString:[ProxySettings getProtocol:HTTP]]) { + self.protocol = HTTP; + } else if ([protocol isEqualToString:[ProxySettings getProtocol:HTTPS]]) { + self.protocol = HTTPS; } else { // This is where we will extend the code to add support for // more proxies, e.g., HTTP proxies. @@ -30,7 +34,7 @@ - (void)saveProxy{ } - (BOOL)isCustom{ - if (self.protocol == SOCKS5) + if (self.protocol == SOCKS5 || self.protocol == HTTP || self.protocol == HTTPS) return true; return false; } @@ -46,7 +50,22 @@ - (NSString*)getProxyString{ if ([ProxySettings isIPv6:self.hostname]) { urlStr = [NSString stringWithFormat:@"socks5://[%@]:%@/", self.hostname, self.port]; // IPv6 must be quoted in URLs } - //URI url = new URI(urlStr); + return urlStr; + } + if (self.protocol == HTTP) { + // Alright, we now need to construct a new HTTP URL. + NSString *urlStr = [NSString stringWithFormat:@"http://%@:%@/", self.hostname, self.port]; + if ([ProxySettings isIPv6:self.hostname]) { + urlStr = [NSString stringWithFormat:@"http://[%@]:%@/", self.hostname, self.port]; // IPv6 must be quoted in URLs + } + return urlStr; + } + if (self.protocol == HTTPS) { + // Alright, we now need to construct a new HTTPS URL. + NSString *urlStr = [NSString stringWithFormat:@"https://%@:%@/", self.hostname, self.port]; + if ([ProxySettings isIPv6:self.hostname]) { + urlStr = [NSString stringWithFormat:@"https://[%@]:%@/", self.hostname, self.port]; // IPv6 must be quoted in URLs + } return urlStr; } return @""; @@ -69,7 +88,13 @@ + (NSString*)getProtocol:(ProxyProtocol) protocol { result = @"proxy_psiphon"; break; case SOCKS5: - result = @"SOCKS5"; + result = @"socks5"; + break; + case HTTP: + result = @"http"; + break; + case HTTPS: + result = @"https"; break; default: result = @"unknown"; diff --git a/ooniprobe/View/Settings/ProxyViewController.m b/ooniprobe/View/Settings/ProxyViewController.m index 4544ea5f..0e6d7443 100644 --- a/ooniprobe/View/Settings/ProxyViewController.m +++ b/ooniprobe/View/Settings/ProxyViewController.m @@ -33,7 +33,11 @@ - (void)reloadRows{ @[[ProxySettings getProtocol:NONE], [ProxySettings getProtocol:PSIPHON], @"proxy_custom"], - @[[ProxySettings getProtocol:SOCKS5]], + @[ + [ProxySettings getProtocol:SOCKS5], + [ProxySettings getProtocol:HTTP], + [ProxySettings getProtocol:HTTPS] + ], @[@"proxy_hostname", @"proxy_port"]]; else items = @[@[[ProxySettings getProtocol:NONE], @@ -124,15 +128,23 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath else if (indexPath.row == 1) currentProxy.protocol = PSIPHON; if (indexPath.row == 2) - [self setCustom]; + [self setCustom:SOCKS5]; + [self reloadRows]; + } else if (indexPath.section == 1){ + if (indexPath.row == 0) + [self setCustom:SOCKS5]; + else if (indexPath.row == 1) + [self setCustom:HTTP]; + else if (indexPath.row == 2) + [self setCustom:HTTPS]; [self reloadRows]; } //[self.view endEditing:YES]; [tableView deselectRowAtIndexPath:indexPath animated:YES]; } --(void)setCustom { - currentProxy.protocol = SOCKS5; +- (void)setCustom:(enum ProxyProtocol)protocol { + currentProxy.protocol = protocol; } -(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string