Permalink
Browse files

visit counts, help page, pass encryption"

;
  • Loading branch information...
1 parent 7162e3c commit d5a5c5ec8ea337d0b045fbcc4f7ff7ba5621ff13 @casparwylie committed May 4, 2017
@@ -7,7 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
- 74D0F5E9CB0A54F9F1333EC7 /* Pods_Strands.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA76AEA0DC651EA2EB870D49 /* Pods_Strands.framework */; };
+ 2E4B3ED2F535E0E6D0B0CE99 /* Pods_Astral.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27AB2A4CB9DB1EC7ED74066D /* Pods_Astral.framework */; };
B0023B6E1EAA586C00F1EC09 /* focal_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B0023B6D1EAA586C00F1EC09 /* focal_icon.png */; };
B0023B711EB8CBD400F1EC09 /* v_down_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B0023B6F1EB8CBD400F1EC09 /* v_down_icon.png */; };
B0023B721EB8CBD400F1EC09 /* v_up_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B0023B701EB8CBD400F1EC09 /* v_up_icon.png */; };
@@ -53,7 +53,7 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
- 1579034A9FAC0DCDE078DF9A /* Pods-Strands.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Strands.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Strands/Pods-Strands.debug.xcconfig"; sourceTree = "<group>"; };
+ 27AB2A4CB9DB1EC7ED74066D /* Pods_Astral.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Astral.framework; sourceTree = BUILT_PRODUCTS_DIR; };
B0023B6D1EAA586C00F1EC09 /* focal_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = focal_icon.png; sourceTree = "<group>"; };
B0023B6F1EB8CBD400F1EC09 /* v_down_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = v_down_icon.png; sourceTree = "<group>"; };
B0023B701EB8CBD400F1EC09 /* v_up_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = v_up_icon.png; sourceTree = "<group>"; };
@@ -86,8 +86,8 @@
B0E356161D995E110088EB10 /* UserInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserInterface.swift; sourceTree = "<group>"; };
B0E3561F1D995E1E0088EB10 /* focalpost */ = {isa = PBXFileReference; lastKnownFileType = folder; path = focalpost; sourceTree = "<group>"; };
B0E356201D995E1E0088EB10 /* focalpost.dae */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml.dae; path = focalpost.dae; sourceTree = "<group>"; };
- D38F9152C59B50F78FC6CDFE /* Pods-Strands.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Strands.release.xcconfig"; path = "Pods/Target Support Files/Pods-Strands/Pods-Strands.release.xcconfig"; sourceTree = "<group>"; };
- EA76AEA0DC651EA2EB870D49 /* Pods_Strands.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Strands.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ E9ECF3C72CCBC475F304CD86 /* Pods-Astral.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Astral.release.xcconfig"; path = "Pods/Target Support Files/Pods-Astral/Pods-Astral.release.xcconfig"; sourceTree = "<group>"; };
+ FE3A2B397D47949F4194E4EC /* Pods-Astral.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Astral.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Astral/Pods-Astral.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -97,7 +97,7 @@
files = (
B069B17B1E0D4EC400873A2E /* opencv2.framework in Frameworks */,
B0476C6B1DA28CFE000FC661 /* Starscream in Frameworks */,
- 74D0F5E9CB0A54F9F1333EC7 /* Pods_Strands.framework in Frameworks */,
+ 2E4B3ED2F535E0E6D0B0CE99 /* Pods_Astral.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -118,11 +118,11 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
- 663580958A3052F68192A6D9 /* Pods */ = {
+ 12B029C36EFC235BB3478A4D /* Pods */ = {
isa = PBXGroup;
children = (
- 1579034A9FAC0DCDE078DF9A /* Pods-Strands.debug.xcconfig */,
- D38F9152C59B50F78FC6CDFE /* Pods-Strands.release.xcconfig */,
+ FE3A2B397D47949F4194E4EC /* Pods-Astral.debug.xcconfig */,
+ E9ECF3C72CCBC475F304CD86 /* Pods-Astral.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
@@ -131,7 +131,7 @@
isa = PBXGroup;
children = (
B0476BF81DA28BCD000FC661 /* Starscream */,
- EA76AEA0DC651EA2EB870D49 /* Pods_Strands.framework */,
+ 27AB2A4CB9DB1EC7ED74066D /* Pods_Astral.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -153,7 +153,7 @@
B0E355FE1D995DBF0088EB10 /* AstralUITests */,
B0E355DD1D995DBF0088EB10 /* Products */,
B0476BF71DA28BCD000FC661 /* Frameworks */,
- 663580958A3052F68192A6D9 /* Pods */,
+ 12B029C36EFC235BB3478A4D /* Pods */,
);
sourceTree = "<group>";
};
@@ -377,7 +377,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Strands/Pods-Strands-frameworks.sh\"\n";
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Astral/Pods-Astral-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
45B5FF1FA05D7A94FCBB6AA6 /* [CP] Check Pods Manifest.lock */ = {
@@ -392,7 +392,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
FB4251B5FC7CA7FA02CB6417 /* [CP] Copy Pods Resources */ = {
@@ -407,7 +407,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Strands/Pods-Strands-resources.sh\"\n";
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Astral/Pods-Astral-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@@ -578,7 +578,7 @@
};
B0E356051D995DBF0088EB10 /* Debug */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = 1579034A9FAC0DCDE078DF9A /* Pods-Strands.debug.xcconfig */;
+ baseConfigurationReference = FE3A2B397D47949F4194E4EC /* Pods-Astral.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
@@ -600,7 +600,7 @@
};
B0E356061D995DBF0088EB10 /* Release */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = D38F9152C59B50F78FC6CDFE /* Pods-Strands.release.xcconfig */;
+ baseConfigurationReference = E9ECF3C72CCBC475F304CD86 /* Pods-Astral.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
View
@@ -40,6 +40,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
+
+ func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask{
+ return UIInterfaceOrientationMask.portrait
+ }
}
@@ -2,6 +2,16 @@
"images" : [
{
"idiom" : "iphone",
+ "size" : "20x20",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "20x20",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
@@ -32,6 +42,16 @@
},
{
"idiom" : "ipad",
+ "size" : "20x20",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "20x20",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
@@ -59,6 +79,11 @@
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "83.5x83.5",
+ "scale" : "2x"
}
],
"info" : {
View
@@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
- <string>$(EXECUTABLE_NAME)</string>
+ <string>Astral</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
@@ -20,6 +20,17 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
+ <key>NSAppTransportSecurity</key>
+ <dict>
+ <key>NSAllowsArbitraryLoads</key>
+ <true/>
+ </dict>
+ <key>NSCameraUsageDescription</key>
+ <string></string>
+ <key>NSLocationWhenInUseUsageDescription</key>
+ <string></string>
+ <key>NSMotionUsageDescription</key>
+ <string></string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
@@ -34,17 +45,6 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
- <key>NSCameraUsageDescription</key>
- <string></string>
- <key>NSLocationWhenInUseUsageDescription</key>
- <string></string>
- <key>NSMotionUsageDescription</key>
- <string></string>
- <key>NSAppTransportSecurity</key>
- <dict>
- <key>NSAllowsArbitraryLoads</key>
- <true/>
- </dict>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
@@ -13,6 +13,7 @@ import CoreMotion
import MapKit
import Starscream
import SwiftyJSON
+import CryptoSwift
class ViewController: UIViewController, LocationDelegate, UIActionDelegate, mapActionDelegate, NetworkResponseDelegate{
@@ -36,12 +37,13 @@ class ViewController: UIViewController, LocationDelegate, UIActionDelegate, mapA
var currentLocation: CLLocation!;
var currMapPoint: MKMapPoint!;
var currentHeading: CLHeading!;
-
+ var keyData: JSON!;
var tempFocalMapPoint: MKMapPoint = MKMapPoint();
var mapPoints: [MKMapPoint] = [];
var coordPoints: [CLLocation] = [];
var realFocalIDs: [Int] = [];
var focalFirstComments = JSON("");
+ var gotKeyData = false;
var focalDistAndBearingsFromUser: [(distance: Int, bearing: Int)] = [];
@@ -83,6 +85,14 @@ class ViewController: UIViewController, LocationDelegate, UIActionDelegate, mapA
self.oldRenderPosition = self.currentLocation;
}
+ if(self.currentLocation.horizontalAccuracy > 10){
+ self.userInterface.updateInfoLabel("Locating Focals, please wait...", show: true, hideAfter: 3);
+ }
+
+ if(gotKeyData == false){
+ getKeyData();
+ }
+
self.focalDistAndBearingsFromUser = [];
var count = 0;
for _ in self.mapPoints{
@@ -165,7 +175,7 @@ class ViewController: UIViewController, LocationDelegate, UIActionDelegate, mapA
let distLimitPX = Int(OpenCVWrapper.buildingDetect(&focalDesValPX, image: image, currPoint: &currentPointPX, pxLength: Int32(pxVals.pxLength), forTapLimit: true)!)!;
if(distLimitPX > -1){
- let distLimitMetres = (distLimitPX / 2)-2;
+ let distLimitMetres = (distLimitPX / 2)-4;
focalLocation = self.location.getPolarCoords(Double(distLimitMetres), bearingDegrees: bearingDegreesTap);
}
@@ -235,7 +245,9 @@ class ViewController: UIViewController, LocationDelegate, UIActionDelegate, mapA
//MARK: new user sign up / profile edit request and response middleware process
func updateUserDataRequest(_ username: String, password: String, fullname: String, email: String) {
- networkRequest.updateUserDataRequest(self.networkWebSocket, username: username, password: password, fullname: fullname, email: email, userID: loggedinUserData.id);
+ let pass = password.sha512();
+ print(pass);
+ networkRequest.updateUserDataRequest(self.networkWebSocket, username: username, password: pass, fullname: fullname, email: email, userID: loggedinUserData.id);
}
@@ -258,7 +270,9 @@ class ViewController: UIViewController, LocationDelegate, UIActionDelegate, mapA
//MARK: User login request and response middleware process
func loginRequest(_ username: String, password: String) {
- networkRequest.loginUserRequest(self.networkWebSocket, username: username, password: password);
+ let pass = password.sha512();
+ print(pass);
+ networkRequest.loginUserRequest(self.networkWebSocket, username: username, password: pass);
}
func userLoggedinResponse(_ responseStr: String) {
@@ -313,7 +327,7 @@ class ViewController: UIViewController, LocationDelegate, UIActionDelegate, mapA
}
func focalCommentsResponse(_ responseStr: String) {
let responseJSON = networkSocket.processResponseAsJSON(responseStr);
- self.userInterface.populateFocalCommentsView(responseJSON["focalComments"], userCommentVotes: responseJSON["commentUserVotes"]);
+ self.userInterface.populateFocalCommentsView(responseJSON["focalComments"], userCommentVotes: responseJSON["commentUserVotes"], focalVisitCount: responseJSON["focalVisitCount"]);
}
//MARK: Post new focal comment request and response middleware process
@@ -354,7 +368,16 @@ class ViewController: UIViewController, LocationDelegate, UIActionDelegate, mapA
self.networkRequest.getRegionData(self.networkWebSocket, currLocation: currentLocation);
}
-
+ //MARK: key data request
+ func getKeyData(){
+ networkRequest.getKeyData(self.networkWebSocket);
+ }
+ func keyDataResponse(_ responseStr: String){
+ let responseJSON = networkSocket.processResponseAsJSON(responseStr);
+ keyData = responseJSON;
+ gotKeyData = true;
+ self.userInterface.renderHelpText(text: keyData["data"][0]["data"].rawString()!);
+ }
//MARK: Main stem
@@ -402,9 +425,9 @@ class ViewController: UIViewController, LocationDelegate, UIActionDelegate, mapA
networkWebSocket = networkSocket.connectWebSocket();
networkSocket.networkResponseDelegate = self;
networkSocket.ui = userInterface;
+
-
super.viewDidLoad();
}
View
@@ -20,9 +20,7 @@ class Misc{
}
}
- func processResponseAsJSON(_ responseData: String) -> JSON{
- let responseData = responseData.data(using: String.Encoding.utf8,allowLossyConversion: false);
- let responseJSON = JSON(data: responseData!);
- return responseJSON;
+ func sha512(string: String){
+
}
}
View
@@ -29,6 +29,7 @@ import SwiftyJSON
@objc optional func postedCommentResponse(_ responseStr: String);
@objc optional func updatedUserDataResponse(_ responseStr: String);
@objc optional func votedCommentResponse(_ responseStr: String);
+ @objc optional func keyDataResponse(_ responseStr: String);
}
@@ -89,6 +90,8 @@ class NetworkSocketHandler{
self.networkResponseDelegate?.updatedUserDataResponse!(responseString);
case "votedComment":
self.networkResponseDelegate?.votedCommentResponse!(responseString);
+ case "keyData":
+ self.networkResponseDelegate?.keyDataResponse!(responseString);
default:
print("failed");
@@ -173,4 +176,9 @@ class NetworkRequestHandler{
NetworkSocketHandler().sendRelevantJsonRequest(socket,requestName: "newVoteCommentRequest", relevantData: organisedRelevantData);
}
+ func getKeyData(_ socket: WebSocket){
+ let organisedRelevantData = ["":""];
+ NetworkSocketHandler().sendRelevantJsonRequest(socket,requestName: "keyDataRequest", relevantData:organisedRelevantData);
+ }
+
}
View
@@ -5,4 +5,5 @@ use_frameworks!
target 'Astral' do
pod 'Starscream', '~> 2.0.0'
pod 'SwiftyJSON'
+ pod 'CryptoSwift'
end
View
@@ -1,15 +1,18 @@
PODS:
- - Starscream (2.0.3)
+ - CryptoSwift (0.6.9)
+ - Starscream (2.0.4)
- SwiftyJSON (3.1.4)
DEPENDENCIES:
+ - CryptoSwift
- Starscream (~> 2.0.0)
- SwiftyJSON
SPEC CHECKSUMS:
- Starscream: 3fdd5c277e57cca6b5c406d274e3f34a7c88f2ce
+ CryptoSwift: a22f6ba238e9ce4d26ee7bf45b9ed82e7122d4a0
+ Starscream: df5974ee928b157c8eda8af8de7c620276b7dfcc
SwiftyJSON: c2842d878f95482ffceec5709abc3d05680c0220
-PODFILE CHECKSUM: cb56271fcc8edd5d6ad4437d73eda6f47fce6f1f
+PODFILE CHECKSUM: 965d9996691eb99db850c95c8d9a7918269c389f
-COCOAPODS: 1.0.1
+COCOAPODS: 1.2.1
Oops, something went wrong.

0 comments on commit d5a5c5e

Please sign in to comment.