Skip to content

Commit

Permalink
[NEW] NWTransport as NSURLSession
Browse files Browse the repository at this point in the history
[NEW] BGTask
  • Loading branch information
ckrey committed Dec 10, 2019
1 parent d29f06c commit 7ecb822
Show file tree
Hide file tree
Showing 32 changed files with 834 additions and 1,410 deletions.
38 changes: 30 additions & 8 deletions OwnTracks/OwnTracks.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
849B1E061FE911FD0016EF1A /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 849B1E081FE911FD0016EF1A /* MainInterface.storyboard */; };
84A046C41D81FE8000796C56 /* IdPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 84A046C31D81FE8000796C56 /* IdPicker.m */; };
84A488E21F7BBFD900ADCF98 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 84A488E11F7BBFD900ADCF98 /* Media.xcassets */; };
84B0CDAD239E2EFA00CE9305 /* BackgroundTasks.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84B0CDAC239E2EFA00CE9305 /* BackgroundTasks.framework */; };
84B7397A1A65629200B103F4 /* LocationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 84B739791A65629200B103F4 /* LocationManager.m */; };
84B776431D9A65C600C707EC /* LoginVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 84B776421D9A65C600C707EC /* LoginVC.m */; };
84CC5A521FEC71850010314C /* OwnTracks-29.png in Resources */ = {isa = PBXBuildFile; fileRef = 84CC5A511FEC71840010314C /* OwnTracks-29.png */; };
Expand All @@ -75,7 +76,6 @@
84E8A18A1BB94782002518AA /* Friend+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E8A1811BB94782002518AA /* Friend+CoreDataProperties.m */; };
84E8A18C1BB94782002518AA /* Waypoint+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E8A1851BB94782002518AA /* Waypoint+CoreDataProperties.m */; };
84E8A18D1BB94782002518AA /* Region+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E8A1871BB94782002518AA /* Region+CoreDataProperties.m */; };
84F0AFE41C830C1D00C9F69F /* AddressBookUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84F0AFE31C830C1D00C9F69F /* AddressBookUI.framework */; platformFilter = ios; };
84FD93072353950100CCEC3B /* OwnTracksEditTVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 84FD93062353950100CCEC3B /* OwnTracksEditTVC.m */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -223,6 +223,7 @@
84A173691B428E5C00CCB7D0 /* Model 8.2.1.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Model 8.2.1.xcdatamodel"; sourceTree = "<group>"; };
84A488E11F7BBFD900ADCF98 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = "<group>"; };
84AF468F1AB9571800E954E3 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
84B0CDAC239E2EFA00CE9305 /* BackgroundTasks.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BackgroundTasks.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/BackgroundTasks.framework; sourceTree = DEVELOPER_DIR; };
84B739781A65629200B103F4 /* LocationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocationManager.h; sourceTree = "<group>"; };
84B739791A65629200B103F4 /* LocationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LocationManager.m; sourceTree = "<group>"; };
84B776411D9A65C600C707EC /* LoginVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginVC.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -273,9 +274,9 @@
buildActionMask = 2147483647;
files = (
84929F0B20AAC0D000227D00 /* WebKit.framework in Frameworks */,
84B0CDAD239E2EFA00CE9305 /* BackgroundTasks.framework in Frameworks */,
841D3525209C74E70084FCD0 /* Contacts.framework in Frameworks */,
841D3523209C5DDF0084FCD0 /* UserNotifications.framework in Frameworks */,
84F0AFE41C830C1D00C9F69F /* AddressBookUI.framework in Frameworks */,
8422AF681AF825C7008932A2 /* SystemConfiguration.framework in Frameworks */,
847F8B5819295C65003876D4 /* CoreMotion.framework in Frameworks */,
8411B82E189FDB140019D2D6 /* CoreGraphics.framework in Frameworks */,
Expand Down Expand Up @@ -340,6 +341,7 @@
8411B82A189FDB140019D2D6 /* Frameworks */ = {
isa = PBXGroup;
children = (
84B0CDAC239E2EFA00CE9305 /* BackgroundTasks.framework */,
84929F0A20AAC0CF00227D00 /* WebKit.framework */,
841D3524209C74E60084FCD0 /* Contacts.framework */,
841D3522209C5DDF0084FCD0 /* UserNotifications.framework */,
Expand Down Expand Up @@ -553,6 +555,7 @@
8411B826189FDB140019D2D6 /* Resources */,
844E826B1AB8061500516D1A /* Embed App Extensions */,
B9074668360D50063C01DD10 /* [CP] Embed Pods Frameworks */,
8466B31E2397F58500537795 /* ShellScript */,
);
buildRules = (
);
Expand Down Expand Up @@ -677,6 +680,25 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
8466B31E2397F58500537795 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/newOutputFile",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "
";
};
A46C33B668D7A90E40A247E6 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -895,7 +917,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
Expand Down Expand Up @@ -941,7 +963,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
Expand All @@ -968,7 +990,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "OwnTracks/OwnTracks-Prefix.pch";
INFOPLIST_FILE = "OwnTracks/OwnTracks-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
Expand Down Expand Up @@ -1007,7 +1029,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "OwnTracks/OwnTracks-Prefix.pch";
INFOPLIST_FILE = "OwnTracks/OwnTracks-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
Expand Down Expand Up @@ -1038,7 +1060,7 @@
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = OwnTracksToday/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1066,7 +1088,7 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = OwnTracksToday/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
4 changes: 2 additions & 2 deletions OwnTracks/OwnTracks/Base.lproj/Launch Screen.xib
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<color key="textColor" name="primaryTintColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="13.2.0" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="wg9-vU-Qvm">
<rect key="frame" x="182" y="584" width="50.5" height="20.5"/>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="13.2.1" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="wg9-vU-Qvm">
<rect key="frame" x="183.5" y="584" width="47.5" height="20.5"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="xFp-b4-JHU"/>
</constraints>
Expand Down
43 changes: 36 additions & 7 deletions OwnTracks/OwnTracks/Base.lproj/Storyboard.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="e04-OU-xZ4">
<device id="retina4_0" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand Down Expand Up @@ -2334,12 +2333,41 @@ xyz</string>
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="9EL-UG-6lg">
<rect key="frame" x="0.0" y="143.5" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="9EL-UG-6lg" id="kic-6z-9LE">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Allow Untrusted Certificates" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aVN-vG-YjO">
<rect key="frame" x="20" y="12" width="223" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ziU-bT-6kO">
<rect key="frame" x="251" y="6.5" width="51" height="31"/>
<connections>
<action selector="changed:" destination="N8y-lP-Jsi" eventType="valueChanged" id="FVB-qA-UyP"/>
</connections>
</switch>
</subviews>
<constraints>
<constraint firstAttribute="centerY" secondItem="ziU-bT-6kO" secondAttribute="centerY" id="9y2-7G-hIh"/>
<constraint firstItem="ziU-bT-6kO" firstAttribute="leading" secondItem="aVN-vG-YjO" secondAttribute="trailing" constant="8" symbolic="YES" id="KMx-t9-fC7"/>
<constraint firstAttribute="centerY" secondItem="aVN-vG-YjO" secondAttribute="centerY" id="hE9-FN-pLC"/>
<constraint firstAttribute="trailing" secondItem="ziU-bT-6kO" secondAttribute="trailing" constant="20" symbolic="YES" id="jX2-c5-eHN"/>
<constraint firstItem="aVN-vG-YjO" firstAttribute="leading" secondItem="kic-6z-9LE" secondAttribute="leading" constant="20" symbolic="YES" id="joO-ZN-vW8"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="Custom Security Policy" id="ZRc-Vw-nIq">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="xnO-D4-hJF">
<rect key="frame" x="0.0" y="191.5" width="320" height="44"/>
<rect key="frame" x="0.0" y="235.5" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="xnO-D4-hJF" id="ObH-AM-D1f">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
Expand Down Expand Up @@ -2368,7 +2396,7 @@ xyz</string>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="9Ay-g4-2UX">
<rect key="frame" x="0.0" y="235.5" width="320" height="44"/>
<rect key="frame" x="0.0" y="279.5" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="9Ay-g4-2UX" id="6AY-dx-eoA">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
Expand Down Expand Up @@ -2402,7 +2430,7 @@ xyz</string>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="3sd-x9-HGh">
<rect key="frame" x="0.0" y="279.5" width="320" height="44"/>
<rect key="frame" x="0.0" y="323.5" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="3sd-x9-HGh" id="Tel-Ur-Be6">
<rect key="frame" x="0.0" y="0.0" width="293" height="44"/>
Expand Down Expand Up @@ -2434,7 +2462,7 @@ xyz</string>
</connections>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="5gd-Vf-r5n">
<rect key="frame" x="0.0" y="323.5" width="320" height="44"/>
<rect key="frame" x="0.0" y="367.5" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="5gd-Vf-r5n" id="NLI-4h-uy5">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
Expand Down Expand Up @@ -2463,7 +2491,7 @@ xyz</string>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="nkk-jT-W9f">
<rect key="frame" x="0.0" y="367.5" width="320" height="44"/>
<rect key="frame" x="0.0" y="411.5" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="nkk-jT-W9f" id="y6s-yP-Eij">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
Expand Down Expand Up @@ -2492,7 +2520,7 @@ xyz</string>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="04N-bQ-Zc1">
<rect key="frame" x="0.0" y="411.5" width="320" height="44"/>
<rect key="frame" x="0.0" y="455.5" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="04N-bQ-Zc1" id="98z-ar-hw3">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
Expand Down Expand Up @@ -2530,6 +2558,7 @@ xyz</string>
</tableView>
<navigationItem key="navigationItem" title="TLS" id="NS8-pg-IlP"/>
<connections>
<outlet property="UIallowUntrustedCertificates" destination="ziU-bT-6kO" id="SDx-UG-AWh"/>
<outlet property="UIallowinvalidcerts" destination="Rk2-Ek-ioh" id="xaw-Ba-SXm"/>
<outlet property="UIclientPKCS" destination="JSF-BR-9Nb" id="MrO-Jc-40p"/>
<outlet property="UIclientPKCSCell" destination="6UU-2x-vMj" id="0ri-oB-PUE"/>
Expand Down
2 changes: 1 addition & 1 deletion OwnTracks/OwnTracks/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ enum state {
willQos:(NSInteger)willQos
willRetainFlag:(BOOL)willRetainFlag
withClientId:(NSString * _Nullable)clientId
securityPolicy:(MQTTSSLSecurityPolicy * _Nullable)securityPolicy
allowUntrustedCertificates:(BOOL)allowUntrustedCertificates
certificates:(NSArray * _Nullable)certificates;

- (void)connectHTTP:(NSString * _Nullable)url
Expand Down

0 comments on commit 7ecb822

Please sign in to comment.