Skip to content

Commit

Permalink
fixed automount
Browse files Browse the repository at this point in the history
  • Loading branch information
twocanoes committed Jan 31, 2024
1 parent 7661fc2 commit 8a9f8c2
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 111 deletions.
2 changes: 1 addition & 1 deletion Profile Manifest/com.twocanoes.xcreds.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>pfm_app_url</key>
<string>https://github.com/twocanoes/xcreds</string>
<key>pfm_description</key>
<string>XCreds 4.0 (6274) OAuth Settings</string>
<string>XCreds 4.1 (6276) OAuth Settings</string>
<key>pfm_documentation_url</key>
<string>https://twocanoes.com/knowledge-base/xcreds-admin-guide/#preferences</string>
<key>pfm_domain</key>
Expand Down
4 changes: 2 additions & 2 deletions ShareMounter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ class ShareMounter {

}

if sharePrefs?.bool(forKey: ShareKeys.finderMount) ?? false {
if true {

myLogger.logit(.debug, message: "Mounting share via Finder")
_ = cliTask("/usr/bin/open \(all_shares[index].url.absoluteString)")
all_shares[index].mountStatus = .mounted
Expand Down
3 changes: 3 additions & 0 deletions XCreds/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, DSQueryable {

}
func applicationDidFinishLaunching(_ aNotification: Notification) {
NetworkMonitor.shared.startMonitoring()


self.statusBarItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
statusBarItem?.isVisible=true
statusBarItem?.menu = statusMenu
Expand Down
14 changes: 14 additions & 0 deletions XCreds/MainController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,22 @@ class MainController: NSObject, UpdateCredentialsFeedbackProtocol {

}

func checkAndMountShares() {

let tickets = KlistUtil().returnTickets()
if tickets.count>0{
let appDelegate = NSApp.delegate as? AppDelegate

appDelegate?.shareMounterMenu?.updateShares(connected: true, tickets: true)
}

}
func setup() {

NotificationCenter.default.addObserver(forName: .connectivityStatus, object: nil, queue: nil) { notification in
self.checkAndMountShares()
}
self.checkAndMountShares()
TCSLogWithMark()

// make sure we have the local password, else prompt. we don't need to save it
Expand Down
24 changes: 12 additions & 12 deletions xCreds.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6275;
CURRENT_PROJECT_VERSION = 6276;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -1455,7 +1455,7 @@
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.0;
MARKETING_VERSION = 4.1;
PRODUCT_BUNDLE_IDENTIFIER = com.twocanoes.XCredsLoginPlugin;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -1473,7 +1473,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6275;
CURRENT_PROJECT_VERSION = 6276;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -1492,7 +1492,7 @@
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.0;
MARKETING_VERSION = 4.1;
PRODUCT_BUNDLE_IDENTIFIER = com.twocanoes.XCredsLoginPlugin;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -1594,7 +1594,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6275;
CURRENT_PROJECT_VERSION = 6276;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -1611,7 +1611,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.0;
MARKETING_VERSION = 4.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.twocanoes.XCreds-Login-Overlay";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -1631,7 +1631,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6275;
CURRENT_PROJECT_VERSION = 6276;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -1648,7 +1648,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.0;
MARKETING_VERSION = 4.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.twocanoes.XCreds-Login-Overlay";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -1781,7 +1781,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6275;
CURRENT_PROJECT_VERSION = 6276;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -1804,7 +1804,7 @@
"$(SDKROOT)/usr/lib/system",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.0;
MARKETING_VERSION = 4.1;
PRODUCT_BUNDLE_IDENTIFIER = com.twocanoes.xcreds;
PRODUCT_NAME = "$(TARGET_NAME)";
STRIP_INSTALLED_PRODUCT = NO;
Expand All @@ -1823,7 +1823,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6275;
CURRENT_PROJECT_VERSION = 6276;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -1846,7 +1846,7 @@
"$(SDKROOT)/usr/lib/system",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.0;
MARKETING_VERSION = 4.1;
PRODUCT_BUNDLE_IDENTIFIER = com.twocanoes.xcreds;
PRODUCT_NAME = "$(TARGET_NAME)";
STRIP_INSTALLED_PRODUCT = NO;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,160 +7,112 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "48D692A2-FB94-4209-82DF-BC69053F0E25"
uuid = "AD703F2B-DAF1-4738-899C-11CCB6497F34"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "XCreds/StatusMenuController.swift"
filePath = "NoMADSession.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "53"
endingLineNumber = "53"
landmarkName = "validateMenuItem(_:)"
startingLineNumber = "1236"
endingLineNumber = "1236"
landmarkName = "userInfo()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "566ED09A-5321-4EBF-95E4-41849CABA14C"
uuid = "E7ACFAB4-E5A6-4D48-B4F7-0BC0DC6ED882"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "ShareMounter.swift"
filePath = "XCreds/MainController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "112"
endingLineNumber = "112"
landmarkName = "getMounts()"
startingLineNumber = "115"
endingLineNumber = "115"
landmarkName = "checkAndMountShares()"
landmarkType = "7">
<Locations>
<Location
uuid = "566ED09A-5321-4EBF-95E4-41849CABA14C - 2b27f75bd8e47083"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "XCreds.ShareMounter.getMounts() -&gt; ()"
moduleName = "XCreds"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/tperfitt/Documents/Projects/xcreds/ShareMounter.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "112"
endingLineNumber = "112"
offsetFromSymbolStart = "2584">
</Location>
<Location
uuid = "566ED09A-5321-4EBF-95E4-41849CABA14C - 2b27f75bd8e47083"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "XCreds.ShareMounter.getMounts() -&gt; ()"
moduleName = "XCreds"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/tperfitt/Documents/Projects/xcreds/ShareMounter.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "112"
endingLineNumber = "112"
offsetFromSymbolStart = "2592">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "D9EEE7A5-0569-4F83-88AD-306E44567BFC"
uuid = "00C34C5C-60B1-4C30-94C8-534B87C9B374"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "XCreds/SelectLocalAccountWindowController.swift"
filePath = "XCreds/ScheduleManager.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "34"
endingLineNumber = "34"
landmarkName = "selectLocalAccountAndUpdate(newPassword:)"
startingLineNumber = "171"
endingLineNumber = "171"
landmarkName = "NoMADUserInformation(user:)"
landmarkType = "7">
<Locations>
<Location
uuid = "D9EEE7A5-0569-4F83-88AD-306E44567BFC - 87eebe3b1909fbb7"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "static XCreds.SelectLocalAccountWindowController.selectLocalAccountAndUpdate(newPassword: Swift.String) -&gt; XCreds.SelectLocalAccountWindowController.VerifyLocalCredentialsResult"
moduleName = "XCreds"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/tperfitt/Documents/Projects/xcreds/XCreds/SelectLocalAccountWindowController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "34"
endingLineNumber = "34"
offsetFromSymbolStart = "856">
</Location>
<Location
uuid = "D9EEE7A5-0569-4F83-88AD-306E44567BFC - bddba436c7839a5a"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "closure #1 @Swift.MainActor () -&gt; () in static XCreds.SelectLocalAccountWindowController.selectLocalAccountAndUpdate(newPassword: Swift.String) -&gt; XCreds.SelectLocalAccountWindowController.VerifyLocalCredentialsResult"
moduleName = "XCreds"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/tperfitt/Documents/Projects/xcreds/XCreds/SelectLocalAccountWindowController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "35"
endingLineNumber = "35"
offsetFromSymbolStart = "48">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "6C3BB5C8-F87C-4280-A376-6FF3005B8236"
uuid = "1A014A3F-393F-4FE5-9A83-79C8DE3F3295"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "XCreds/StatusMenuController.swift"
filePath = "XCreds/ScheduleManager.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "108"
endingLineNumber = "108"
landmarkName = "validateMenuItem(_:)"
startingLineNumber = "159"
endingLineNumber = "159"
landmarkName = "NoMADAuthenticationSucceded()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "D4D41778-258D-42CF-A91F-1FEC9F0DC853"
uuid = "895D5BFA-B444-4C09-BBEB-274B6989EC37"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "XCreds/MainController.swift"
filePath = "XCredsLoginPlugIn/LoginWindow/SignInWindowController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "196"
endingLineNumber = "196"
landmarkName = "credentialsUpdated(_:)"
startingLineNumber = "792"
endingLineNumber = "792"
landmarkName = "NoMADAuthenticationSucceded()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "5211E3D8-D374-4A48-8C36-5527D1983FF1"
uuid = "E50B6015-51C1-47D9-B267-0BF80EDEFC66"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "XCreds/MainController.swift"
filePath = "XCreds/ScheduleManager.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "166"
endingLineNumber = "166"
landmarkName = "NoMADAuthenticationFailed(error:description:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "E0705EEB-075C-4FA0-A500-BD7C34B7F800"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "NoMADSession.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "201"
endingLineNumber = "201"
landmarkName = "credentialsUpdated(_:)"
startingLineNumber = "1149"
endingLineNumber = "1149"
landmarkName = "authenticate(authTestOnly:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<key>auth_mech_fixup.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>6</integer>
<integer>7</integer>
</dict>
<key>authrights.xcscheme_^#shared#^_</key>
<dict>
Expand All @@ -42,7 +42,7 @@
<key>test.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>7</integer>
<integer>6</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
Expand Down

0 comments on commit 8a9f8c2

Please sign in to comment.