Skip to content

Commit

Permalink
fixed issue with crash if time is far off
Browse files Browse the repository at this point in the history
  • Loading branch information
twocanoes committed Apr 17, 2023
1 parent f960172 commit 9c1d0d8
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 235 deletions.
14 changes: 9 additions & 5 deletions XCreds/WebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ class WebViewController: NSWindowController {
if currentBundle.bundlePath.contains("XCreds") {
TCSLogWithMark()
let loadPageURL = currentBundle.url(forResource: "errorpage", withExtension: "html")
TCSLogWithMark(loadPageURL?.debugDescription ?? "none")
self.webView.load(URLRequest(url:loadPageURL!))
if let loadPageURL = loadPageURL {
TCSLogWithMark(loadPageURL.debugDescription ?? "none")
self.webView.load(URLRequest(url:loadPageURL))
}
break
}
}
Expand All @@ -60,12 +62,14 @@ class WebViewController: NSWindowController {
else {
let allBundles = Bundle.allBundles
for currentBundle in allBundles {
TCSLogWithMark(currentBundle.bundlePath)
if currentBundle.bundlePath.contains("XCreds") {
TCSLogWithMark(currentBundle.bundlePath)
TCSLogWithMark()
let loadPageURL = currentBundle.url(forResource: "loadpage", withExtension: "html")
TCSLogWithMark(loadPageURL?.debugDescription ?? "none")
self.webView.load(URLRequest(url:loadPageURL!))
TCSLogWithMark(loadPageURL.debugDescription ?? "none")
if let loadPageURL = loadPageURL {
self.webView.load(URLRequest(url:loadPageURL))
}
break

}
Expand Down
29 changes: 23 additions & 6 deletions xCreds.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
76ACEA7D2890EBF900216E6E /* WifiManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7677908428908E40004E7085 /* WifiManager.swift */; };
76B040A428EFC788002A289B /* Helper+JWTDecode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76B040A328EFC788002A289B /* Helper+JWTDecode.swift */; };
76B040A528EFC788002A289B /* Helper+JWTDecode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76B040A328EFC788002A289B /* Helper+JWTDecode.swift */; };
76B356DB29E9CA180037DDDB /* OIDCLite in Frameworks */ = {isa = PBXBuildFile; productRef = 76B356DA29E9CA180037DDDB /* OIDCLite */; };
76B882AA29CCFD7A00BB8186 /* TCSKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = 76B882A829CCFD7900BB8186 /* TCSKeychain.m */; };
76B882AB29CCFD7A00BB8186 /* TCSKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = 76B882A829CCFD7900BB8186 /* TCSKeychain.m */; };
76B882AE29CCFDAE00BB8186 /* NSData+SHA1.m in Sources */ = {isa = PBXBuildFile; fileRef = 76B882AC29CCFDAE00BB8186 /* NSData+SHA1.m */; };
Expand Down Expand Up @@ -371,6 +372,7 @@
766CC42829D3A3DC009BC526 /* ProductLicense.framework in Frameworks */,
766CC42A29D3A3DC009BC526 /* Paddle.framework in Frameworks */,
76319369287D24F600D36BF7 /* ArgumentParser in Frameworks */,
76B356DB29E9CA180037DDDB /* OIDCLite in Frameworks */,
76319366287D24E100D36BF7 /* ArgumentParser in Frameworks */,
76DD6D17285997F300A700ED /* OIDCLite in Frameworks */,
);
Expand Down Expand Up @@ -681,6 +683,7 @@
76DD6D16285997F300A700ED /* OIDCLite */,
76319365287D24E100D36BF7 /* ArgumentParser */,
76319368287D24F600D36BF7 /* ArgumentParser */,
76B356DA29E9CA180037DDDB /* OIDCLite */,
);
productName = xCreds;
productReference = 76EE069A27FD1D00009E0F3A /* XCreds.app */;
Expand Down Expand Up @@ -726,6 +729,7 @@
packageReferences = (
76319364287D24E100D36BF7 /* XCRemoteSwiftPackageReference "swift-argument-parser" */,
76319367287D24F600D36BF7 /* XCRemoteSwiftPackageReference "swift-argument-parser" */,
76B356D929E9CA180037DDDB /* XCRemoteSwiftPackageReference "OIDCLite" */,
);
productRefGroup = 76EE069B27FD1D00009E0F3A /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -1001,7 +1005,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3600;
CURRENT_PROJECT_VERSION = 3602;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1038,7 +1042,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3600;
CURRENT_PROJECT_VERSION = 3602;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1103,7 +1107,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3600;
CURRENT_PROJECT_VERSION = 3602;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1139,7 +1143,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3600;
CURRENT_PROJECT_VERSION = 3602;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1288,7 +1292,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3600;
CURRENT_PROJECT_VERSION = 3602;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1323,7 +1327,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3600;
CURRENT_PROJECT_VERSION = 3602;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1426,6 +1430,14 @@
minimumVersion = 1.0.0;
};
};
76B356D929E9CA180037DDDB /* XCRemoteSwiftPackageReference "OIDCLite" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/twocanoes/OIDCLite";
requirement = {
branch = main;
kind = branch;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
Expand All @@ -1448,6 +1460,11 @@
isa = XCSwiftPackageProductDependency;
productName = OIDCLite;
};
76B356DA29E9CA180037DDDB /* OIDCLite */ = {
isa = XCSwiftPackageProductDependency;
package = 76B356D929E9CA180037DDDB /* XCRemoteSwiftPackageReference "OIDCLite" */;
productName = OIDCLite;
};
76DD6D16285997F300A700ED /* OIDCLite */ = {
isa = XCSwiftPackageProductDependency;
productName = OIDCLite;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
{
"object": {
"pins": [
{
"package": "swift-argument-parser",
"repositoryURL": "https://github.com/apple/swift-argument-parser.git",
"state": {
"branch": null,
"revision": "df9ee6676cd5b3bf5b330ec7568a5644f547201b",
"version": "1.1.3"
}
"pins" : [
{
"identity" : "oidclite",
"kind" : "remoteSourceControl",
"location" : "https://github.com/twocanoes/OIDCLite",
"state" : {
"branch" : "main",
"revision" : "bdc22bb4d448d7c2832b4438bead2d6b4af08f59"
}
]
},
"version": 1
},
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser.git",
"state" : {
"revision" : "df9ee6676cd5b3bf5b330ec7568a5644f547201b",
"version" : "1.1.3"
}
}
],
"version" : 2
}
Binary file not shown.

0 comments on commit 9c1d0d8

Please sign in to comment.