├── .DS_Store ├── README.md ├── SwitchJSS.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── SwitchJSS ├── .DS_Store ├── AddJSSViewController.swift ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ └── Main.storyboard ├── Document.swift ├── Document.xcdatamodeld │ ├── .xccurrentversion │ └── Document.xcdatamodel │ │ └── contents ├── Info.plist ├── JSSInfo+CoreDataProperties.swift ├── JSSInfo.swift ├── JSSSwitcher.swift ├── Screen Shot.png └── ViewController.swift ├── SwitchJSSTests ├── Info.plist └── SwitchJSSTests.swift └── SwitchJSSUITests ├── Info.plist └── SwitchJSSUITests.swift /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jason-tratta/SwitchJSS/b3f3bced6973001213864a1222aea72055e8349f/.DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SwitchJSS 2 | 3 | SwitchJSS is a small application that saves your JSS server addresses and quickly switches your Casper Suite tools to that address. 4 | No more option+clicking and retyping every time! 5 | 6 | Get the latest release compiled on the release page. https://github.com/jason-tratta/SwitchJSS/releases/tag/v.0.5 7 | 8 | ![alt tag](https://github.com/jason-tratta/SwitchJSS/blob/master/SwitchJSS/Screen%20Shot.png) 9 | 10 | 11 | Version .5 Release Notes 12 | - New Document Structure: Servers can be saved and shared with files. 13 | - Removed Selected button and replaced it with a Selected label. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /SwitchJSS.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 38D866041BED36E50077D32F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38D866031BED36E50077D32F /* AppDelegate.swift */; }; 11 | 38D866061BED36E50077D32F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38D866051BED36E50077D32F /* ViewController.swift */; }; 12 | 38D866081BED36E50077D32F /* Document.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38D866071BED36E50077D32F /* Document.swift */; }; 13 | 38D8660B1BED36E50077D32F /* Document.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 38D866091BED36E50077D32F /* Document.xcdatamodeld */; }; 14 | 38D8660D1BED36E50077D32F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 38D8660C1BED36E50077D32F /* Assets.xcassets */; }; 15 | 38D866101BED36E50077D32F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 38D8660E1BED36E50077D32F /* Main.storyboard */; }; 16 | 38D866351BED37810077D32F /* JSSInfo+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38D866331BED37810077D32F /* JSSInfo+CoreDataProperties.swift */; }; 17 | 38D866361BED37810077D32F /* JSSInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38D866341BED37810077D32F /* JSSInfo.swift */; }; 18 | 38D866381BED37890077D32F /* JSSSwitcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38D866371BED37890077D32F /* JSSSwitcher.swift */; }; 19 | 38D8663A1BED378F0077D32F /* AddJSSViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38D866391BED378F0077D32F /* AddJSSViewController.swift */; }; 20 | 38EE70AB1BF0F448006C4265 /* Screen Shot.png in Resources */ = {isa = PBXBuildFile; fileRef = 38EE70AA1BF0F448006C4265 /* Screen Shot.png */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | 38D866001BED36E50077D32F /* SwitchJSS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwitchJSS.app; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | 38D866031BED36E50077D32F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 26 | 38D866051BED36E50077D32F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 27 | 38D866071BED36E50077D32F /* Document.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Document.swift; sourceTree = ""; }; 28 | 38D8660A1BED36E50077D32F /* Document.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Document.xcdatamodel; sourceTree = ""; }; 29 | 38D8660C1BED36E50077D32F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 30 | 38D8660F1BED36E50077D32F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 31 | 38D866111BED36E50077D32F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 38D8661A1BED36E50077D32F /* SwitchJSSTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwitchJSSTests.swift; sourceTree = ""; }; 33 | 38D8661C1BED36E50077D32F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 34 | 38D866251BED36E50077D32F /* SwitchJSSUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwitchJSSUITests.swift; sourceTree = ""; }; 35 | 38D866271BED36E50077D32F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 36 | 38D866331BED37810077D32F /* JSSInfo+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "JSSInfo+CoreDataProperties.swift"; sourceTree = ""; }; 37 | 38D866341BED37810077D32F /* JSSInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSSInfo.swift; sourceTree = ""; }; 38 | 38D866371BED37890077D32F /* JSSSwitcher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSSSwitcher.swift; sourceTree = ""; }; 39 | 38D866391BED378F0077D32F /* AddJSSViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddJSSViewController.swift; sourceTree = ""; }; 40 | 38EE70AA1BF0F448006C4265 /* Screen Shot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Screen Shot.png"; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | 38D865FD1BED36E50077D32F /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | ); 49 | runOnlyForDeploymentPostprocessing = 0; 50 | }; 51 | /* End PBXFrameworksBuildPhase section */ 52 | 53 | /* Begin PBXGroup section */ 54 | 38D865F71BED36E50077D32F = { 55 | isa = PBXGroup; 56 | children = ( 57 | 38D866021BED36E50077D32F /* SwitchJSS */, 58 | 38D866191BED36E50077D32F /* SwitchJSSTests */, 59 | 38D866241BED36E50077D32F /* SwitchJSSUITests */, 60 | 38D866011BED36E50077D32F /* Products */, 61 | ); 62 | sourceTree = ""; 63 | }; 64 | 38D866011BED36E50077D32F /* Products */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 38D866001BED36E50077D32F /* SwitchJSS.app */, 68 | ); 69 | name = Products; 70 | sourceTree = ""; 71 | }; 72 | 38D866021BED36E50077D32F /* SwitchJSS */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 38D866031BED36E50077D32F /* AppDelegate.swift */, 76 | 38D866051BED36E50077D32F /* ViewController.swift */, 77 | 38D866071BED36E50077D32F /* Document.swift */, 78 | 38D866391BED378F0077D32F /* AddJSSViewController.swift */, 79 | 38D866371BED37890077D32F /* JSSSwitcher.swift */, 80 | 38D8660C1BED36E50077D32F /* Assets.xcassets */, 81 | 38D8660E1BED36E50077D32F /* Main.storyboard */, 82 | 38D866111BED36E50077D32F /* Info.plist */, 83 | 38D866091BED36E50077D32F /* Document.xcdatamodeld */, 84 | 38D866331BED37810077D32F /* JSSInfo+CoreDataProperties.swift */, 85 | 38D866341BED37810077D32F /* JSSInfo.swift */, 86 | 38EE70AA1BF0F448006C4265 /* Screen Shot.png */, 87 | ); 88 | path = SwitchJSS; 89 | sourceTree = ""; 90 | }; 91 | 38D866191BED36E50077D32F /* SwitchJSSTests */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 38D8661A1BED36E50077D32F /* SwitchJSSTests.swift */, 95 | 38D8661C1BED36E50077D32F /* Info.plist */, 96 | ); 97 | path = SwitchJSSTests; 98 | sourceTree = ""; 99 | }; 100 | 38D866241BED36E50077D32F /* SwitchJSSUITests */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 38D866251BED36E50077D32F /* SwitchJSSUITests.swift */, 104 | 38D866271BED36E50077D32F /* Info.plist */, 105 | ); 106 | path = SwitchJSSUITests; 107 | sourceTree = ""; 108 | }; 109 | /* End PBXGroup section */ 110 | 111 | /* Begin PBXNativeTarget section */ 112 | 38D865FF1BED36E50077D32F /* SwitchJSS */ = { 113 | isa = PBXNativeTarget; 114 | buildConfigurationList = 38D8662A1BED36E50077D32F /* Build configuration list for PBXNativeTarget "SwitchJSS" */; 115 | buildPhases = ( 116 | 38D865FC1BED36E50077D32F /* Sources */, 117 | 38D865FD1BED36E50077D32F /* Frameworks */, 118 | 38D865FE1BED36E50077D32F /* Resources */, 119 | ); 120 | buildRules = ( 121 | ); 122 | dependencies = ( 123 | ); 124 | name = SwitchJSS; 125 | productName = SwitchJSS; 126 | productReference = 38D866001BED36E50077D32F /* SwitchJSS.app */; 127 | productType = "com.apple.product-type.application"; 128 | }; 129 | /* End PBXNativeTarget section */ 130 | 131 | /* Begin PBXProject section */ 132 | 38D865F81BED36E50077D32F /* Project object */ = { 133 | isa = PBXProject; 134 | attributes = { 135 | LastSwiftUpdateCheck = 0710; 136 | LastUpgradeCheck = 0830; 137 | ORGANIZATIONNAME = "Indiana University"; 138 | TargetAttributes = { 139 | 38D865FF1BED36E50077D32F = { 140 | CreatedOnToolsVersion = 7.1; 141 | LastSwiftMigration = 0830; 142 | }; 143 | }; 144 | }; 145 | buildConfigurationList = 38D865FB1BED36E50077D32F /* Build configuration list for PBXProject "SwitchJSS" */; 146 | compatibilityVersion = "Xcode 3.2"; 147 | developmentRegion = English; 148 | hasScannedForEncodings = 0; 149 | knownRegions = ( 150 | en, 151 | Base, 152 | ); 153 | mainGroup = 38D865F71BED36E50077D32F; 154 | productRefGroup = 38D866011BED36E50077D32F /* Products */; 155 | projectDirPath = ""; 156 | projectRoot = ""; 157 | targets = ( 158 | 38D865FF1BED36E50077D32F /* SwitchJSS */, 159 | ); 160 | }; 161 | /* End PBXProject section */ 162 | 163 | /* Begin PBXResourcesBuildPhase section */ 164 | 38D865FE1BED36E50077D32F /* Resources */ = { 165 | isa = PBXResourcesBuildPhase; 166 | buildActionMask = 2147483647; 167 | files = ( 168 | 38D8660D1BED36E50077D32F /* Assets.xcassets in Resources */, 169 | 38EE70AB1BF0F448006C4265 /* Screen Shot.png in Resources */, 170 | 38D866101BED36E50077D32F /* Main.storyboard in Resources */, 171 | ); 172 | runOnlyForDeploymentPostprocessing = 0; 173 | }; 174 | /* End PBXResourcesBuildPhase section */ 175 | 176 | /* Begin PBXSourcesBuildPhase section */ 177 | 38D865FC1BED36E50077D32F /* Sources */ = { 178 | isa = PBXSourcesBuildPhase; 179 | buildActionMask = 2147483647; 180 | files = ( 181 | 38D866381BED37890077D32F /* JSSSwitcher.swift in Sources */, 182 | 38D8660B1BED36E50077D32F /* Document.xcdatamodeld in Sources */, 183 | 38D866061BED36E50077D32F /* ViewController.swift in Sources */, 184 | 38D866351BED37810077D32F /* JSSInfo+CoreDataProperties.swift in Sources */, 185 | 38D866041BED36E50077D32F /* AppDelegate.swift in Sources */, 186 | 38D8663A1BED378F0077D32F /* AddJSSViewController.swift in Sources */, 187 | 38D866361BED37810077D32F /* JSSInfo.swift in Sources */, 188 | 38D866081BED36E50077D32F /* Document.swift in Sources */, 189 | ); 190 | runOnlyForDeploymentPostprocessing = 0; 191 | }; 192 | /* End PBXSourcesBuildPhase section */ 193 | 194 | /* Begin PBXVariantGroup section */ 195 | 38D8660E1BED36E50077D32F /* Main.storyboard */ = { 196 | isa = PBXVariantGroup; 197 | children = ( 198 | 38D8660F1BED36E50077D32F /* Base */, 199 | ); 200 | name = Main.storyboard; 201 | sourceTree = ""; 202 | }; 203 | /* End PBXVariantGroup section */ 204 | 205 | /* Begin XCBuildConfiguration section */ 206 | 38D866281BED36E50077D32F /* Debug */ = { 207 | isa = XCBuildConfiguration; 208 | buildSettings = { 209 | ALWAYS_SEARCH_USER_PATHS = NO; 210 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 211 | CLANG_CXX_LIBRARY = "libc++"; 212 | CLANG_ENABLE_MODULES = YES; 213 | CLANG_ENABLE_OBJC_ARC = YES; 214 | CLANG_WARN_BOOL_CONVERSION = YES; 215 | CLANG_WARN_CONSTANT_CONVERSION = YES; 216 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 217 | CLANG_WARN_EMPTY_BODY = YES; 218 | CLANG_WARN_ENUM_CONVERSION = YES; 219 | CLANG_WARN_INFINITE_RECURSION = YES; 220 | CLANG_WARN_INT_CONVERSION = YES; 221 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 222 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 223 | CLANG_WARN_UNREACHABLE_CODE = YES; 224 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 225 | CODE_SIGN_IDENTITY = "-"; 226 | COPY_PHASE_STRIP = NO; 227 | DEBUG_INFORMATION_FORMAT = dwarf; 228 | ENABLE_STRICT_OBJC_MSGSEND = YES; 229 | ENABLE_TESTABILITY = YES; 230 | GCC_C_LANGUAGE_STANDARD = gnu99; 231 | GCC_DYNAMIC_NO_PIC = NO; 232 | GCC_NO_COMMON_BLOCKS = YES; 233 | GCC_OPTIMIZATION_LEVEL = 0; 234 | GCC_PREPROCESSOR_DEFINITIONS = ( 235 | "DEBUG=1", 236 | "$(inherited)", 237 | ); 238 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 239 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 240 | GCC_WARN_UNDECLARED_SELECTOR = YES; 241 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 242 | GCC_WARN_UNUSED_FUNCTION = YES; 243 | GCC_WARN_UNUSED_VARIABLE = YES; 244 | MACOSX_DEPLOYMENT_TARGET = 10.10; 245 | MTL_ENABLE_DEBUG_INFO = YES; 246 | ONLY_ACTIVE_ARCH = YES; 247 | SDKROOT = macosx; 248 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 249 | }; 250 | name = Debug; 251 | }; 252 | 38D866291BED36E50077D32F /* Release */ = { 253 | isa = XCBuildConfiguration; 254 | buildSettings = { 255 | ALWAYS_SEARCH_USER_PATHS = NO; 256 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 257 | CLANG_CXX_LIBRARY = "libc++"; 258 | CLANG_ENABLE_MODULES = YES; 259 | CLANG_ENABLE_OBJC_ARC = YES; 260 | CLANG_WARN_BOOL_CONVERSION = YES; 261 | CLANG_WARN_CONSTANT_CONVERSION = YES; 262 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 263 | CLANG_WARN_EMPTY_BODY = YES; 264 | CLANG_WARN_ENUM_CONVERSION = YES; 265 | CLANG_WARN_INFINITE_RECURSION = YES; 266 | CLANG_WARN_INT_CONVERSION = YES; 267 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 268 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 269 | CLANG_WARN_UNREACHABLE_CODE = YES; 270 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 271 | CODE_SIGN_IDENTITY = "-"; 272 | COPY_PHASE_STRIP = NO; 273 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 274 | ENABLE_NS_ASSERTIONS = NO; 275 | ENABLE_STRICT_OBJC_MSGSEND = YES; 276 | GCC_C_LANGUAGE_STANDARD = gnu99; 277 | GCC_NO_COMMON_BLOCKS = YES; 278 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 279 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 280 | GCC_WARN_UNDECLARED_SELECTOR = YES; 281 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 282 | GCC_WARN_UNUSED_FUNCTION = YES; 283 | GCC_WARN_UNUSED_VARIABLE = YES; 284 | MACOSX_DEPLOYMENT_TARGET = 10.10; 285 | MTL_ENABLE_DEBUG_INFO = NO; 286 | SDKROOT = macosx; 287 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 288 | }; 289 | name = Release; 290 | }; 291 | 38D8662B1BED36E50077D32F /* Debug */ = { 292 | isa = XCBuildConfiguration; 293 | buildSettings = { 294 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 295 | COMBINE_HIDPI_IMAGES = YES; 296 | INFOPLIST_FILE = SwitchJSS/Info.plist; 297 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 298 | MACOSX_DEPLOYMENT_TARGET = 10.10; 299 | PRODUCT_BUNDLE_IDENTIFIER = com.jasontratta.SwitchJSS; 300 | PRODUCT_NAME = "$(TARGET_NAME)"; 301 | SWIFT_VERSION = 3.0; 302 | }; 303 | name = Debug; 304 | }; 305 | 38D8662C1BED36E50077D32F /* Release */ = { 306 | isa = XCBuildConfiguration; 307 | buildSettings = { 308 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 309 | COMBINE_HIDPI_IMAGES = YES; 310 | INFOPLIST_FILE = SwitchJSS/Info.plist; 311 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 312 | MACOSX_DEPLOYMENT_TARGET = 10.10; 313 | PRODUCT_BUNDLE_IDENTIFIER = com.jasontratta.SwitchJSS; 314 | PRODUCT_NAME = "$(TARGET_NAME)"; 315 | SWIFT_VERSION = 3.0; 316 | }; 317 | name = Release; 318 | }; 319 | /* End XCBuildConfiguration section */ 320 | 321 | /* Begin XCConfigurationList section */ 322 | 38D865FB1BED36E50077D32F /* Build configuration list for PBXProject "SwitchJSS" */ = { 323 | isa = XCConfigurationList; 324 | buildConfigurations = ( 325 | 38D866281BED36E50077D32F /* Debug */, 326 | 38D866291BED36E50077D32F /* Release */, 327 | ); 328 | defaultConfigurationIsVisible = 0; 329 | defaultConfigurationName = Release; 330 | }; 331 | 38D8662A1BED36E50077D32F /* Build configuration list for PBXNativeTarget "SwitchJSS" */ = { 332 | isa = XCConfigurationList; 333 | buildConfigurations = ( 334 | 38D8662B1BED36E50077D32F /* Debug */, 335 | 38D8662C1BED36E50077D32F /* Release */, 336 | ); 337 | defaultConfigurationIsVisible = 0; 338 | defaultConfigurationName = Release; 339 | }; 340 | /* End XCConfigurationList section */ 341 | 342 | /* Begin XCVersionGroup section */ 343 | 38D866091BED36E50077D32F /* Document.xcdatamodeld */ = { 344 | isa = XCVersionGroup; 345 | children = ( 346 | 38D8660A1BED36E50077D32F /* Document.xcdatamodel */, 347 | ); 348 | currentVersion = 38D8660A1BED36E50077D32F /* Document.xcdatamodel */; 349 | path = Document.xcdatamodeld; 350 | sourceTree = ""; 351 | versionGroupType = wrapper.xcdatamodel; 352 | }; 353 | /* End XCVersionGroup section */ 354 | }; 355 | rootObject = 38D865F81BED36E50077D32F /* Project object */; 356 | } 357 | -------------------------------------------------------------------------------- /SwitchJSS.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SwitchJSS/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jason-tratta/SwitchJSS/b3f3bced6973001213864a1222aea72055e8349f/SwitchJSS/.DS_Store -------------------------------------------------------------------------------- /SwitchJSS/AddJSSViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AddJSSViewController.swift 3 | // SwitchJSS 4 | // 5 | // Created by Tratta, Jason A on 9/3/15. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | //Copyright (c) 2015 Jason Tratta 10 | // 11 | //Permission is hereby granted, free of charge, to any person obtaining a copy 12 | //of this software and associated documentation files (the "Software"), to deal 13 | //in the Software without restriction, including without limitation the rights 14 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | //copies of the Software, and to permit persons to whom the Software is 16 | //furnished to do so, subject to the following conditions: 17 | // 18 | //The above copyright notice and this permission notice shall be included in all 19 | //copies or substantial portions of the Software. 20 | // 21 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 27 | //SOFTWARE. 28 | 29 | import Cocoa 30 | import CoreData 31 | 32 | class AddViewController: NSViewController { 33 | 34 | 35 | 36 | @IBOutlet weak var jssNameTextField: NSTextField! 37 | @IBOutlet weak var jssAddressTextField: NSTextField! 38 | @IBOutlet weak var allowUntrusedButton: NSButton! 39 | 40 | 41 | @IBAction func addJSS(_ sender: AnyObject) { 42 | 43 | let theDoc = NSDocumentController.shared().currentDocument as! NSPersistentDocument 44 | let managedObjectContext = theDoc.managedObjectContext 45 | 46 | let jssObject = NSEntityDescription.insertNewObject(forEntityName: "JSSInfo", into: managedObjectContext!) as! JSSInfo 47 | 48 | jssObject.setValue(jssNameTextField.stringValue, forKey: "labelName") 49 | jssObject.setValue(jssAddressTextField.stringValue, forKey: "jssAddress") 50 | 51 | if allowUntrusedButton.state == 1 { 52 | 53 | jssObject.setValue(true, forKey: "allowInvalidCert") 54 | 55 | } else { 56 | 57 | jssObject.setValue(false, forKey: "allowInvalidCert") 58 | } 59 | 60 | self.dismiss(self) 61 | 62 | } 63 | 64 | 65 | 66 | @IBAction func cancelButton(_ sender: AnyObject) { 67 | 68 | 69 | self.dismiss(self) 70 | 71 | } 72 | 73 | 74 | 75 | 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /SwitchJSS/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SwitchJSS 4 | // 5 | // Created by Tratta, Jason A on 11/6/15. 6 | // The MIT License (MIT) 7 | // 8 | //Copyright (c) 2015 Jason Tratta 9 | // 10 | //Permission is hereby granted, free of charge, to any person obtaining a copy 11 | //of this software and associated documentation files (the "Software"), to deal 12 | //in the Software without restriction, including without limitation the rights 13 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | //copies of the Software, and to permit persons to whom the Software is 15 | //furnished to do so, subject to the following conditions: 16 | // 17 | //The above copyright notice and this permission notice shall be included in all 18 | //copies or substantial portions of the Software. 19 | // 20 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | //SOFTWARE. 27 | 28 | import Cocoa 29 | 30 | @NSApplicationMain 31 | class AppDelegate: NSObject, NSApplicationDelegate { 32 | 33 | 34 | 35 | func applicationDidFinishLaunching(_ aNotification: Notification) { 36 | // Insert code here to initialize your application 37 | } 38 | 39 | func applicationWillTerminate(_ aNotification: Notification) { 40 | // Insert code here to tear down your application 41 | } 42 | 43 | 44 | } 45 | 46 | -------------------------------------------------------------------------------- /SwitchJSS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /SwitchJSS/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | Default 510 | 511 | 512 | 513 | 514 | 515 | 516 | Left to Right 517 | 518 | 519 | 520 | 521 | 522 | 523 | Right to Left 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | Default 535 | 536 | 537 | 538 | 539 | 540 | 541 | Left to Right 542 | 543 | 544 | 545 | 546 | 547 | 548 | Right to Left 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 686 | 697 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 916 | 933 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | -------------------------------------------------------------------------------- /SwitchJSS/Document.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Document.swift 3 | // SwitchJSS 4 | // 5 | // The MIT License (MIT) 6 | // 7 | //Copyright (c) 2015 Jason Tratta 8 | // 9 | //Permission is hereby granted, free of charge, to any person obtaining a copy 10 | //of this software and associated documentation files (the "Software"), to deal 11 | //in the Software without restriction, including without limitation the rights 12 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | //copies of the Software, and to permit persons to whom the Software is 14 | //furnished to do so, subject to the following conditions: 15 | // 16 | //The above copyright notice and this permission notice shall be included in all 17 | //copies or substantial portions of the Software. 18 | // 19 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | //SOFTWARE. 26 | 27 | import Cocoa 28 | 29 | class Document: NSPersistentDocument { 30 | 31 | override init() { 32 | super.init() 33 | // Add your subclass-specific initialization here. 34 | 35 | } 36 | 37 | override func windowControllerDidLoadNib(_ aController: NSWindowController) { 38 | super.windowControllerDidLoadNib(aController) 39 | // Add any code here that needs to be executed once the windowController has loaded the document's window. 40 | } 41 | 42 | override class func autosavesInPlace() -> Bool { 43 | return true 44 | } 45 | 46 | override func makeWindowControllers() { 47 | // Returns the Storyboard that contains your Document window. 48 | let storyboard = NSStoryboard(name: "Main", bundle: nil) 49 | let windowController = storyboard.instantiateController(withIdentifier: "Document Window Controller") as! NSWindowController 50 | windowController.contentViewController?.representedObject = self 51 | self.addWindowController(windowController) 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /SwitchJSS/Document.xcdatamodeld/.xccurrentversion: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _XCCurrentVersionName 6 | Document.xcdatamodel 7 | 8 | 9 | -------------------------------------------------------------------------------- /SwitchJSS/Document.xcdatamodeld/Document.xcdatamodel/contents: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /SwitchJSS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDocumentTypes 8 | 9 | 10 | CFBundleTypeExtensions 11 | 12 | binary 13 | 14 | CFBundleTypeMIMETypes 15 | 16 | application/octet-stream 17 | 18 | CFBundleTypeName 19 | Binary 20 | CFBundleTypeRole 21 | Editor 22 | LSTypeIsPackage 23 | 24 | NSDocumentClass 25 | $(PRODUCT_MODULE_NAME).Document 26 | NSPersistentStoreTypeKey 27 | Binary 28 | 29 | 30 | CFBundleTypeExtensions 31 | 32 | sqlite 33 | 34 | CFBundleTypeMIMETypes 35 | 36 | application/octet-stream 37 | 38 | CFBundleTypeName 39 | SQLite 40 | CFBundleTypeRole 41 | Editor 42 | LSTypeIsPackage 43 | 44 | NSDocumentClass 45 | $(PRODUCT_MODULE_NAME).Document 46 | NSPersistentStoreTypeKey 47 | SQLite 48 | 49 | 50 | CFBundleTypeExtensions 51 | 52 | xml 53 | 54 | CFBundleTypeIconFile 55 | 56 | CFBundleTypeMIMETypes 57 | 58 | text/xml 59 | 60 | CFBundleTypeName 61 | XML 62 | CFBundleTypeOSTypes 63 | 64 | ???? 65 | 66 | CFBundleTypeRole 67 | Editor 68 | LSTypeIsPackage 69 | 70 | NSDocumentClass 71 | $(PRODUCT_MODULE_NAME).Document 72 | NSPersistentStoreTypeKey 73 | XML 74 | 75 | 76 | CFBundleExecutable 77 | $(EXECUTABLE_NAME) 78 | CFBundleIconFile 79 | 80 | CFBundleIdentifier 81 | $(PRODUCT_BUNDLE_IDENTIFIER) 82 | CFBundleInfoDictionaryVersion 83 | 6.0 84 | CFBundleName 85 | $(PRODUCT_NAME) 86 | CFBundlePackageType 87 | APPL 88 | CFBundleShortVersionString 89 | 0.5 90 | CFBundleSignature 91 | ???? 92 | CFBundleVersion 93 | 0.5 94 | LSApplicationCategoryType 95 | public.app-category.utilities 96 | LSMinimumSystemVersion 97 | $(MACOSX_DEPLOYMENT_TARGET) 98 | NSHumanReadableCopyright 99 | Copyright © 2015 Jason Tratta. All rights reserved. 100 | NSMainStoryboardFile 101 | Main 102 | NSPrincipalClass 103 | NSApplication 104 | 105 | 106 | -------------------------------------------------------------------------------- /SwitchJSS/JSSInfo+CoreDataProperties.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JSSInfo+CoreDataProperties.swift 3 | // SwitchJSS 4 | // 5 | // Created by Tratta, Jason A on 11/6/15. 6 | // The MIT License (MIT) 7 | // 8 | //Copyright (c) 2015 Jason Tratta 9 | // 10 | //Permission is hereby granted, free of charge, to any person obtaining a copy 11 | //of this software and associated documentation files (the "Software"), to deal 12 | //in the Software without restriction, including without limitation the rights 13 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | //copies of the Software, and to permit persons to whom the Software is 15 | //furnished to do so, subject to the following conditions: 16 | // 17 | //The above copyright notice and this permission notice shall be included in all 18 | //copies or substantial portions of the Software. 19 | // 20 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | //SOFTWARE. 27 | 28 | import Foundation 29 | import CoreData 30 | 31 | extension JSSInfo { 32 | 33 | @NSManaged var allowInvalidCert: NSNumber? 34 | @NSManaged var jssAddress: String? 35 | @NSManaged var labelName: String? 36 | @NSManaged var selected: NSNumber? 37 | 38 | } 39 | -------------------------------------------------------------------------------- /SwitchJSS/JSSInfo.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JSSInfo.swift 3 | // SwitchJSS 4 | // 5 | // Created by Tratta, Jason A on 11/6/15. 6 | // The MIT License (MIT) 7 | // 8 | //Copyright (c) 2015 Jason Tratta 9 | // 10 | //Permission is hereby granted, free of charge, to any person obtaining a copy 11 | //of this software and associated documentation files (the "Software"), to deal 12 | //in the Software without restriction, including without limitation the rights 13 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | //copies of the Software, and to permit persons to whom the Software is 15 | //furnished to do so, subject to the following conditions: 16 | // 17 | //The above copyright notice and this permission notice shall be included in all 18 | //copies or substantial portions of the Software. 19 | // 20 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | //SOFTWARE. 27 | 28 | import Foundation 29 | import CoreData 30 | 31 | 32 | class JSSInfo: NSManagedObject { 33 | 34 | // Insert code here to add functionality to your managed object subclass 35 | 36 | } 37 | -------------------------------------------------------------------------------- /SwitchJSS/JSSSwitcher.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JSSSwitcher.swift 3 | // SwitchJSS 4 | // 5 | // Created by Tratta, Jason A on 9/30/15. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | //Copyright (c) 2015 Jason Tratta 10 | // 11 | //Permission is hereby granted, free of charge, to any person obtaining a copy 12 | //of this software and associated documentation files (the "Software"), to deal 13 | //in the Software without restriction, including without limitation the rights 14 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | //copies of the Software, and to permit persons to whom the Software is 16 | //furnished to do so, subject to the following conditions: 17 | // 18 | //The above copyright notice and this permission notice shall be included in all 19 | //copies or substantial portions of the Software. 20 | // 21 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 27 | //SOFTWARE. 28 | 29 | import Cocoa 30 | 31 | class JSSSwitcher { 32 | 33 | 34 | var jssDictionary = NSMutableDictionary() 35 | var reconDictionary = NSMutableDictionary() 36 | 37 | 38 | func readJss() { 39 | 40 | let thePath = "~~/Library/Preferences/com.jamfsoftware.jss.plist" 41 | let theData = FileManager.default.contents(atPath: thePath) 42 | 43 | do { 44 | try jssDictionary = PropertyListSerialization.propertyList(from: theData!, options: .mutableContainersAndLeaves, format:nil) as! NSMutableDictionary 45 | } catch { 46 | 47 | debugPrint("Property List Data Serialization Failed") 48 | } 49 | 50 | 51 | let casperString = jssDictionary.object(forKey: "url") 52 | debugPrint("JSSSwitcher:" + (casperString as! String)) 53 | 54 | //Lets Get Recon for completeness. Recon portion is not working as expected 55 | /* 56 | let reconPath = "~~/Library/Preferences/com.jamfsoftware.Recon.plist" 57 | let reconData = NSFileManager.defaultManager().contentsAtPath(reconPath) 58 | 59 | do { 60 | try reconDictionary = NSPropertyListSerialization.propertyListWithData(reconData!, options: .MutableContainersAndLeaves, format:nil) as! NSMutableDictionary 61 | } catch { 62 | 63 | debugPrint("Property List Data Serialization Failed") 64 | } 65 | 66 | 67 | let reconString = reconDictionary.objectForKey("url") 68 | debugPrint("JSSSwitcher:" + (reconString as! String)) 69 | */ 70 | 71 | 72 | } 73 | 74 | 75 | func setJssServer(_ server: String, allowInval: String) { 76 | 77 | 78 | let path = NSString(string: "~/Library/Preferences/com.jamfsoftware.jss.plist").expandingTildeInPath 79 | jssDictionary.setObject(server, forKey: "url" as NSCopying) 80 | jssDictionary.setObject(allowInval, forKey: "allowInvalidCertificate" as NSCopying) 81 | 82 | do { 83 | 84 | let saveData = try PropertyListSerialization.data(fromPropertyList: jssDictionary, format: .xml, options:0) 85 | try? saveData.write(to: URL(fileURLWithPath: path), options: [.atomic]) 86 | 87 | } catch { 88 | 89 | debugPrint("Failed to Write JSS Location") 90 | 91 | } 92 | 93 | /* Recon portion is not working as expected 94 | let reconPath = NSString(string: "~/Library/Preferences/com.jamfsoftware.Recon.plist").stringByExpandingTildeInPath 95 | reconDictionary.setObject(server, forKey: "server") 96 | 97 | do { 98 | 99 | let saveData = try NSPropertyListSerialization.dataWithPropertyList(reconDictionary, format: .XMLFormat_v1_0, options:0) 100 | saveData.writeToFile(reconPath, atomically: true) 101 | 102 | } catch { 103 | 104 | debugPrint("Failed to Write JSS Location") 105 | 106 | } 107 | 108 | */ 109 | 110 | } 111 | 112 | //End of Class 113 | 114 | } 115 | -------------------------------------------------------------------------------- /SwitchJSS/Screen Shot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jason-tratta/SwitchJSS/b3f3bced6973001213864a1222aea72055e8349f/SwitchJSS/Screen Shot.png -------------------------------------------------------------------------------- /SwitchJSS/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SwitchJSS 4 | // 5 | // Created by Tratta, Jason A on 2/13/15. 6 | // 7 | // The MIT License (MIT) 8 | // 9 | //Copyright (c) 2015 Jason Tratta 10 | // 11 | //Permission is hereby granted, free of charge, to any person obtaining a copy 12 | //of this software and associated documentation files (the "Software"), to deal 13 | //in the Software without restriction, including without limitation the rights 14 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | //copies of the Software, and to permit persons to whom the Software is 16 | //furnished to do so, subject to the following conditions: 17 | // 18 | //The above copyright notice and this permission notice shall be included in all 19 | //copies or substantial portions of the Software. 20 | // 21 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 27 | //SOFTWARE. 28 | 29 | 30 | import Cocoa 31 | 32 | 33 | var JSApplicationDidFinishLoading = "apploaded" 34 | 35 | class ViewController: NSViewController { 36 | 37 | var statusBar = NSStatusBar.system() 38 | var statusBarItem : NSStatusItem = NSStatusItem() 39 | var theMenu:NSMenu = NSMenu() 40 | var theEditMenuItem : NSMenuItem = NSMenuItem(title: "Open", action: Selector(("editButton:")), keyEquivalent: "") 41 | 42 | 43 | var managedObjectContext = NSManagedObjectContext(concurrencyType: .mainQueueConcurrencyType) 44 | var theDocument = NSPersistentDocument() 45 | 46 | 47 | @IBOutlet weak var tableView: NSTableView! 48 | @IBOutlet var arrayController: NSArrayController! 49 | @IBOutlet var selectedLabel: NSTextField! 50 | 51 | 52 | 53 | override func viewDidLoad() { 54 | super.viewDidLoad() 55 | 56 | // Do any additional setup after loading the view. 57 | 58 | print("ViewDidLoad") 59 | 60 | 61 | 62 | 63 | //Add statusBarItem 64 | statusBarItem = statusBar.statusItem(withLength: -1) 65 | statusBarItem.menu = theMenu 66 | statusBarItem.title = "JSS" 67 | statusBarItem.target = self 68 | statusBarItem.action = #selector(ViewController.editButtton(_:)) 69 | 70 | 71 | theEditMenuItem.target = self 72 | theEditMenuItem.action = #selector(ViewController.editButtton(_:)) 73 | theMenu.addItem(theEditMenuItem) 74 | 75 | } 76 | 77 | 78 | override func viewWillAppear() { 79 | 80 | print("Will Appear") 81 | } 82 | 83 | override var representedObject: Any? { 84 | didSet { 85 | // Update the view, if already loaded. 86 | theDocument = representedObject as! NSPersistentDocument 87 | managedObjectContext = theDocument.managedObjectContext! 88 | arrayController.managedObjectContext = managedObjectContext 89 | 90 | 91 | print("DidSet") 92 | print(theDocument) 93 | 94 | } 95 | } 96 | 97 | 98 | 99 | 100 | 101 | func closeWindow() { 102 | 103 | view.window?.orderOut(self) 104 | 105 | 106 | 107 | } 108 | 109 | 110 | 111 | 112 | 113 | @IBAction func editButtton(_ sender: AnyObject) { 114 | 115 | 116 | 117 | view.window?.orderFront(self) 118 | view.window?.becomeFirstResponder() 119 | 120 | 121 | } 122 | 123 | 124 | @IBAction func selectJSSButton(_ sender: AnyObject) { 125 | 126 | 127 | let jssObject = tableView.selectedRow 128 | 129 | let allObjects = arrayController.arrangedObjects as! [JSSInfo] 130 | 131 | for aObject:JSSInfo in allObjects { 132 | 133 | aObject.selected = 0 134 | 135 | } 136 | 137 | 138 | let object = (arrayController.arrangedObjects as? AnyObject)?.object(at:jssObject) as! JSSInfo 139 | object.selected = 1 140 | let allowInval = object.allowInvalidCert 141 | var allowBoolString = "" 142 | 143 | if allowInval == 0 { 144 | 145 | allowBoolString = "false" 146 | print("false") 147 | 148 | } else { 149 | 150 | allowBoolString = "true" 151 | print("true") 152 | } 153 | 154 | 155 | let jssSwitch = JSSSwitcher() 156 | jssSwitch.setJssServer(object.jssAddress!, allowInval: allowBoolString) 157 | selectedLabel.stringValue = object.labelName! 158 | 159 | 160 | 161 | } 162 | 163 | 164 | 165 | 166 | //End Class 167 | 168 | } 169 | -------------------------------------------------------------------------------- /SwitchJSSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /SwitchJSSTests/SwitchJSSTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwitchJSSTests.swift 3 | // SwitchJSSTests 4 | // 5 | // Created by Tratta, Jason A on 11/6/15. 6 | // Copyright © 2015 Indiana University. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import SwitchJSS 11 | 12 | class SwitchJSSTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /SwitchJSSUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /SwitchJSSUITests/SwitchJSSUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwitchJSSUITests.swift 3 | // SwitchJSSUITests 4 | // 5 | // Created by Tratta, Jason A on 11/6/15. 6 | // Copyright © 2015 Indiana University. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class SwitchJSSUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | if #available(OSX 10.11, *) { 22 | XCUIApplication().launch() 23 | } else { 24 | // Fallback on earlier versions 25 | } 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | override func tearDown() { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | super.tearDown() 33 | } 34 | 35 | func testExample() { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | } 41 | --------------------------------------------------------------------------------