From 69bd8728f1bdffe43f35bdad07aca7a8a470a37f Mon Sep 17 00:00:00 2001 From: Leslie Helou Date: Wed, 5 Apr 2023 19:27:25 -0400 Subject: [PATCH] color fix, fix smart group export, cleanup --- README.md | 3 + .../contents.xcworkspacedata | 2 +- .../xcschemes/jamf-migrator.xcscheme | 84 +++++++++++ .../jamf-migrator - backup mode.xcscheme | 100 +++++++++++++ .../jamf-migrator headless migrate.xcscheme | 132 ++++++++++++++++++ .../xcschemes/jamf-migrator help.xcscheme | 84 +++++++++++ .../xcschemes/jamf-migrator ldap.xcscheme | 88 ++++++++++++ .../xcschemes/xcschememanagement.plist | 42 ++++++ jamf-migrator/Base.lproj/Main.storyboard | 4 +- .../Base.lproj/Preferences.storyboard | 4 +- jamf-migrator/Info.plist | 2 +- jamf-migrator/ViewController.swift | 52 ++++--- 12 files changed, 571 insertions(+), 26 deletions(-) create mode 100644 jamf-migrator.xcodeproj/xcshareddata/xcschemes/jamf-migrator.xcscheme create mode 100644 jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/jamf-migrator - backup mode.xcscheme create mode 100644 jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/jamf-migrator headless migrate.xcscheme create mode 100644 jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/jamf-migrator help.xcscheme create mode 100644 jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/jamf-migrator ldap.xcscheme create mode 100644 jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/xcschememanagement.plist diff --git a/README.md b/README.md index 169c6fb..a54e9cb 100644 --- a/README.md +++ b/README.md @@ -175,6 +175,9 @@ This can also be accomplished using the UI by launching jamf-migrator from Termi ## History +**v7.1.1**
+Prevent configuration profiles that include a Filevault payload from migrating. Fix export of smart comuter/device groups. Fix color mismatch (issue #88) + **v7.1.0**
Command line functionality. Note, -backup has been renamed -export and allows for specific types of objects to be exported. Exported scripts no longer have characters XML encoded. Expire tokens when quitting app. diff --git a/jamf-migrator.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/jamf-migrator.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 841c964..2abe3a4 100755 --- a/jamf-migrator.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/jamf-migrator.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:/Users/lesliehelou/Library/Mobile Documents/com~apple~CloudDocs/GitHub/JamfMigrator/jamf-migrator.xcodeproj"> diff --git a/jamf-migrator.xcodeproj/xcshareddata/xcschemes/jamf-migrator.xcscheme b/jamf-migrator.xcodeproj/xcshareddata/xcschemes/jamf-migrator.xcscheme new file mode 100644 index 0000000..3151f98 --- /dev/null +++ b/jamf-migrator.xcodeproj/xcshareddata/xcschemes/jamf-migrator.xcscheme @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/jamf-migrator - backup mode.xcscheme b/jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/jamf-migrator - backup mode.xcscheme new file mode 100644 index 0000000..a07c9d6 --- /dev/null +++ b/jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/jamf-migrator - backup mode.xcscheme @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/jamf-migrator headless migrate.xcscheme b/jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/jamf-migrator headless migrate.xcscheme new file mode 100644 index 0000000..97f6abd --- /dev/null +++ b/jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/jamf-migrator headless migrate.xcscheme @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/jamf-migrator help.xcscheme b/jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/jamf-migrator help.xcscheme new file mode 100644 index 0000000..7eda553 --- /dev/null +++ b/jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/jamf-migrator help.xcscheme @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/jamf-migrator ldap.xcscheme b/jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/jamf-migrator ldap.xcscheme new file mode 100644 index 0000000..ebdff6e --- /dev/null +++ b/jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/jamf-migrator ldap.xcscheme @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/xcschememanagement.plist b/jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..1fced7c --- /dev/null +++ b/jamf-migrator.xcodeproj/xcuserdata/leslie.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,42 @@ + + + + + SchemeUserState + + jamf-migrator - backup mode.xcscheme + + orderHint + 0 + + jamf-migrator headless migrate.xcscheme + + orderHint + 3 + + jamf-migrator help.xcscheme + + orderHint + 4 + + jamf-migrator ldap.xcscheme + + orderHint + 2 + + jamf-migrator.xcscheme_^#shared#^_ + + orderHint + 1 + + + SuppressBuildableAutocreation + + 9BC01C5B1DFB0C07007E634E + + primary + + + + + diff --git a/jamf-migrator/Base.lproj/Main.storyboard b/jamf-migrator/Base.lproj/Main.storyboard index f0adf2b..4a8748d 100644 --- a/jamf-migrator/Base.lproj/Main.storyboard +++ b/jamf-migrator/Base.lproj/Main.storyboard @@ -2194,7 +2194,7 @@ - + @@ -2407,7 +2407,7 @@ - + diff --git a/jamf-migrator/Base.lproj/Preferences.storyboard b/jamf-migrator/Base.lproj/Preferences.storyboard index fa2bbee..a74ba92 100644 --- a/jamf-migrator/Base.lproj/Preferences.storyboard +++ b/jamf-migrator/Base.lproj/Preferences.storyboard @@ -1,8 +1,8 @@ - + - + diff --git a/jamf-migrator/Info.plist b/jamf-migrator/Info.plist index d1cccf4..85f6e01 100644 --- a/jamf-migrator/Info.plist +++ b/jamf-migrator/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 20230310.181837 + 20230405.212540 LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion diff --git a/jamf-migrator/ViewController.swift b/jamf-migrator/ViewController.swift index ea03ac9..d9861cf 100644 --- a/jamf-migrator/ViewController.swift +++ b/jamf-migrator/ViewController.swift @@ -867,6 +867,7 @@ class ViewController: NSViewController, URLSessionDelegate, NSTabViewDelegate, N if setting.fullGUI { put_levelIndicator.fillColor = .green + get_levelIndicator.fillColor = .green // which migration mode tab are we on if activeTab(fn: "Go") == "selective" { migrationMode = "selective" @@ -3867,12 +3868,7 @@ class ViewController: NSViewController, URLSessionDelegate, NSTabViewDelegate, N if tagValue2(xmlString: PostXML, startTag: "", endTag: "") == "Cloud Distribution Point" { PostXML = regexDistroUrl.stringByReplacingMatches(in: PostXML, options: [], range: NSRange(0..") } - // clear JCDS url from network segments xml - end - // if not migrating netboot server remove then from network segments xml - start -// if self.objectsToMigrate.firstIndex(of: "netbootservers") == 0 { -// PostXML = regexNetBoot.stringByReplacingMatches(in: PostXML, options: [], range: NSRange(0..") -// } - // if not migrating netboot server remove then from network segments xml - end + // if not migrating software update server remove then from network segments xml - start if self.objectsToMigrate.firstIndex(of: "softwareupdateservers") == 0 { PostXML = regexSUS.stringByReplacingMatches(in: PostXML, options: [], range: NSRange(0..") @@ -3955,6 +3951,12 @@ class ViewController: NSViewController, URLSessionDelegate, NSTabViewDelegate, N PostXML = regexComp.stringByReplacingMatches(in: PostXML, options: [], range: NSRange(0..(.*?)", options:.caseInsensitive) +// PostXML = regexDistro.stringByReplacingMatches(in: PostXML, options: [], range: NSRange(0..default") +// } + // migrating to another site if JamfProServer.toSite && destinationSite != "" && endpoint == "policies" { PostXML = setSite(xmlString: PostXML, site: destinationSite, endpoint: endpoint) @@ -5462,21 +5464,28 @@ class ViewController: NSViewController, URLSessionDelegate, NSTabViewDelegate, N } } - if let _ = exclusions[dependencyNode] { - let scope_excl_dep = exclusions[dependencyNode] as! [AnyObject] - for theObject in scope_excl_dep { - let local_name = (theObject as! [String:Any])["name"] - let local_id = (theObject as! [String:Any])["id"] - dependencyArray["\(local_name!)"] = "\(local_id!)" + if dependencyNode == "computer_groups" { + print("check for exclusions: \(exclusions)") + if let _ = exclusions[dependencyNode] { + let scope_excl_compGrp_dep = exclusions[dependencyNode] as! [[String:Any]] + // let scope_excl_compGrp_dep = scope_excl_dep["computer_groups"] as! [String:Any] + print("exclusions: \(scope_excl_compGrp_dep)") + for theObject in scope_excl_compGrp_dep { + print("theObject: \(theObject)") + let local_name = theObject["name"] as! String + let local_id = theObject["id"] as! Int + dependencyArray["\(local_name)"] = "\(local_id)" + print("dependencyArray: \(dependencyArray)") + } } - } - - if let _ = limitations[dependencyNode] { - let scope_excl_dep = limitations[dependencyNode] as! [AnyObject] - for theObject in scope_excl_dep { - let local_name = (theObject as! [String:Any])["name"] - let local_id = (theObject as! [String:Any])["id"] - dependencyArray["\(local_name!)"] = "\(local_id!)" + + if let _ = limitations[dependencyNode] { + let scope_excl_dep = limitations[dependencyNode] as! [AnyObject] + for theObject in scope_excl_dep { + let local_name = (theObject as! [String:Any])["name"] + let local_id = (theObject as! [String:Any])["id"] + dependencyArray["\(local_name!)"] = "\(local_id!)" + } } } } @@ -8286,6 +8295,9 @@ extension String { let fqdnArray = fqdn.components(separatedBy: ":") fqdn = fqdnArray[0] } + if fqdn.last == "/" { + fqdn = String(fqdn.dropLast()) + } return fqdn } }