Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eb3cc85403 | |||
| 51b171fcb7 | |||
| 316d576715 | |||
| c6a1c3e785 | |||
| 20ceff19fe | |||
| 93ae7d634f | |||
| 766356d4a3 | |||
| bd68ecfbab | |||
| f1ebfa05bd | |||
| c8231a15ae | |||
| 4c81f92105 | |||
| 14a2f4077f | |||
| 9be8b62dc9 | |||
| 4b5448a4b6 | |||
| 7cb3bf5e4d | |||
| c3ca122b27 | |||
| f4af791fac | |||
| adbdc52603 | |||
| ef7341e9a5 | |||
| 6705cd100b | |||
| e5c9f80318 | |||
| caa96f7634 | |||
| a0acf3e309 | |||
| d546366b63 | |||
| 1997006727 | |||
| d6a007b7bc | |||
| c076b3cf79 | |||
| bd81825eb6 | |||
| c67bf82f1c | |||
| edbfb57081 | |||
| 15ef64fad1 | |||
| 335a978ea3 | |||
| 29f8316c7d | |||
| 163c257ad3 | |||
| 155f350ec3 | |||
| 21ad6e8422 | |||
| 75372a3bf4 | |||
| e1c5eb2028 | |||
| 5a7e71b582 | |||
| 4c8911d2a6 | |||
| 294aa4c785 | |||
| 6e8235f48c | |||
| e033c54c75 | |||
| 4d53fab0c1 | |||
| f162c98605 |
+68
@@ -0,0 +1,68 @@
|
||||
|
||||
*.xcuserstate
|
||||
|
||||
# Xcode
|
||||
#
|
||||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||
|
||||
## Build generated
|
||||
build/
|
||||
DerivedData/
|
||||
|
||||
## Various settings
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata/
|
||||
|
||||
## Other
|
||||
*.moved-aside
|
||||
*.xcuserstate
|
||||
|
||||
## Obj-C/Swift specific
|
||||
*.hmap
|
||||
*.ipa
|
||||
*.dSYM.zip
|
||||
*.dSYM
|
||||
|
||||
## Playgrounds
|
||||
timeline.xctimeline
|
||||
playground.xcworkspace
|
||||
|
||||
# Swift Package Manager
|
||||
#
|
||||
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
|
||||
# Packages/
|
||||
.build/
|
||||
|
||||
# CocoaPods
|
||||
#
|
||||
# We recommend against adding the Pods directory to your .gitignore. However
|
||||
# you should judge for yourself, the pros and cons are mentioned at:
|
||||
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
||||
#
|
||||
# Pods/
|
||||
|
||||
# Carthage
|
||||
#
|
||||
# Add this line if you want to avoid checking in source code from Carthage dependencies.
|
||||
# Carthage/Checkouts
|
||||
|
||||
Carthage/Build
|
||||
|
||||
# fastlane
|
||||
#
|
||||
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
||||
# screenshots whenever they are needed.
|
||||
# For more information about the recommended setup visit:
|
||||
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
|
||||
|
||||
fastlane/report.xml
|
||||
fastlane/Preview.html
|
||||
fastlane/screenshots
|
||||
fastlane/test_output
|
||||
@@ -18,14 +18,11 @@
|
||||
0A59C2721E3D09CE00E40A2B /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A59C2711E3D09CE00E40A2B /* Constants.swift */; };
|
||||
0A59C2741E3D0C0E00E40A2B /* GetIt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A59C2731E3D0C0E00E40A2B /* GetIt.swift */; };
|
||||
0A8DA5DA1E3E808500148315 /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A8DA5D91E3E808500148315 /* AboutViewController.swift */; };
|
||||
0AAAC76C208664EB009C6ACB /* progressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AAAC76B208664EB009C6ACB /* progressView.swift */; };
|
||||
0AAC75B61E3E24800086BB87 /* DownloadButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AAC75B51E3E24800086BB87 /* DownloadButton.swift */; };
|
||||
0AAC75B81E3E25820086BB87 /* GrayButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AAC75B71E3E25820086BB87 /* GrayButton.swift */; };
|
||||
0AF763CF1E474D2A00403BA1 /* InstallationGuideViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AF763CD1E474D2A00403BA1 /* InstallationGuideViewController.swift */; };
|
||||
0AF763D21E476D4C00403BA1 /* openTerminalButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AF763D11E476D4C00403BA1 /* openTerminalButton.swift */; };
|
||||
0AF763D41E47B90D00403BA1 /* InstallationGuideTexts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AF763D31E47B90D00403BA1 /* InstallationGuideTexts.swift */; };
|
||||
0AF763D61E47C71500403BA1 /* installationGuideTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AF763D51E47C71500403BA1 /* installationGuideTextField.swift */; };
|
||||
57A713EE30F5529EC97CABA2 /* Pods_Youtube_dl_GUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 685C0FDD28B58EDB6BF51860 /* Pods_Youtube_dl_GUI.framework */; };
|
||||
656FE9E68E618252B653F728 /* Pods_Get_It.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F840AEEA491FC0DE6DE63CC /* Pods_Get_It.framework */; };
|
||||
0AFE6EDE20ACB49E002C7693 /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AFE6EDD20ACB49E002C7693 /* Logger.swift */; };
|
||||
89FEC36FE494806C0C0FAF5E /* Pods_Get_It.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F840AEEA491FC0DE6DE63CC /* Pods_Get_It.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@@ -42,12 +39,10 @@
|
||||
0A59C2711E3D09CE00E40A2B /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
|
||||
0A59C2731E3D0C0E00E40A2B /* GetIt.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetIt.swift; sourceTree = "<group>"; };
|
||||
0A8DA5D91E3E808500148315 /* AboutViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = "<group>"; };
|
||||
0AAAC76B208664EB009C6ACB /* progressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = progressView.swift; sourceTree = "<group>"; };
|
||||
0AAC75B51E3E24800086BB87 /* DownloadButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloadButton.swift; sourceTree = "<group>"; };
|
||||
0AAC75B71E3E25820086BB87 /* GrayButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GrayButton.swift; sourceTree = "<group>"; };
|
||||
0AF763CD1E474D2A00403BA1 /* InstallationGuideViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InstallationGuideViewController.swift; sourceTree = "<group>"; };
|
||||
0AF763D11E476D4C00403BA1 /* openTerminalButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = openTerminalButton.swift; sourceTree = "<group>"; };
|
||||
0AF763D31E47B90D00403BA1 /* InstallationGuideTexts.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InstallationGuideTexts.swift; sourceTree = "<group>"; };
|
||||
0AF763D51E47C71500403BA1 /* installationGuideTextField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = installationGuideTextField.swift; sourceTree = "<group>"; };
|
||||
0AFE6EDD20ACB49E002C7693 /* Logger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logger.swift; sourceTree = "<group>"; };
|
||||
2F2FF097A134B03DBD16D354 /* Pods-Youtube-dl-GUI.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Youtube-dl-GUI.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Youtube-dl-GUI/Pods-Youtube-dl-GUI.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
3D0235652B5434027EFB9C78 /* Pods-Get It.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Get It.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Get It/Pods-Get It.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
3F840AEEA491FC0DE6DE63CC /* Pods_Get_It.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Get_It.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@@ -61,8 +56,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
57A713EE30F5529EC97CABA2 /* Pods_Youtube_dl_GUI.framework in Frameworks */,
|
||||
656FE9E68E618252B653F728 /* Pods_Get_It.framework in Frameworks */,
|
||||
89FEC36FE494806C0C0FAF5E /* Pods_Get_It.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -108,7 +102,6 @@
|
||||
0A59C26D1E3D01A700E40A2B /* WindowController.swift */,
|
||||
0A59C26F1E3D01F400E40A2B /* OptionsViewController.swift */,
|
||||
0A8DA5D91E3E808500148315 /* AboutViewController.swift */,
|
||||
0AF763CD1E474D2A00403BA1 /* InstallationGuideViewController.swift */,
|
||||
);
|
||||
name = Controller;
|
||||
sourceTree = "<group>";
|
||||
@@ -121,8 +114,7 @@
|
||||
0AAC75B71E3E25820086BB87 /* GrayButton.swift */,
|
||||
0A2BF1F71E460F170002C5B7 /* optionsTextfield.swift */,
|
||||
0A2BF1F91E4619230002C5B7 /* secureOptionsTextfield.swift */,
|
||||
0AF763D11E476D4C00403BA1 /* openTerminalButton.swift */,
|
||||
0AF763D51E47C71500403BA1 /* installationGuideTextField.swift */,
|
||||
0AAAC76B208664EB009C6ACB /* progressView.swift */,
|
||||
);
|
||||
name = View;
|
||||
sourceTree = "<group>";
|
||||
@@ -131,6 +123,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0A59C2731E3D0C0E00E40A2B /* GetIt.swift */,
|
||||
0AFE6EDD20ACB49E002C7693 /* Logger.swift */,
|
||||
);
|
||||
name = Model;
|
||||
sourceTree = "<group>";
|
||||
@@ -139,7 +132,6 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0A59C2711E3D09CE00E40A2B /* Constants.swift */,
|
||||
0AF763D31E47B90D00403BA1 /* InstallationGuideTexts.swift */,
|
||||
);
|
||||
name = "Constants and Text";
|
||||
sourceTree = "<group>";
|
||||
@@ -176,7 +168,6 @@
|
||||
0A3153121CF37A660020DBB8 /* Frameworks */,
|
||||
0A3153131CF37A660020DBB8 /* Resources */,
|
||||
A74C311D5C3277F0388523F0 /* [CP] Embed Pods Frameworks */,
|
||||
9D05C236239CF9791F408CA6 /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -194,7 +185,7 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0730;
|
||||
LastUpgradeCheck = 0820;
|
||||
LastUpgradeCheck = 1020;
|
||||
ORGANIZATIONNAME = "Kevin De Koninck";
|
||||
TargetAttributes = {
|
||||
0A3153141CF37A660020DBB8 = {
|
||||
@@ -213,6 +204,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
@@ -245,28 +237,16 @@
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-Get It-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_ROOT}/../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;
|
||||
};
|
||||
9D05C236239CF9791F408CA6 /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Get It/Pods-Get It-resources.sh\"\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# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
A74C311D5C3277F0388523F0 /* [CP] Embed Pods Frameworks */ = {
|
||||
@@ -275,14 +255,20 @@
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Get It/Pods-Get It-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/ITSwitch/ITSwitch.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/LetsMove/LetsMove.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/STPrivilegedTask/STPrivilegedTask.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ITSwitch.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LetsMove.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/STPrivilegedTask.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Get It/Pods-Get It-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Get It/Pods-Get It-frameworks.sh\"\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
@@ -293,19 +279,17 @@
|
||||
files = (
|
||||
0AAC75B61E3E24800086BB87 /* DownloadButton.swift in Sources */,
|
||||
0A59C2721E3D09CE00E40A2B /* Constants.swift in Sources */,
|
||||
0AF763D21E476D4C00403BA1 /* openTerminalButton.swift in Sources */,
|
||||
0AAC75B81E3E25820086BB87 /* GrayButton.swift in Sources */,
|
||||
0A8DA5DA1E3E808500148315 /* AboutViewController.swift in Sources */,
|
||||
0AF763D61E47C71500403BA1 /* installationGuideTextField.swift in Sources */,
|
||||
0A2BF1FA1E4619230002C5B7 /* secureOptionsTextfield.swift in Sources */,
|
||||
0A2BF1F81E460F170002C5B7 /* optionsTextfield.swift in Sources */,
|
||||
0AFE6EDE20ACB49E002C7693 /* Logger.swift in Sources */,
|
||||
0A31531B1CF37A660020DBB8 /* ViewController.swift in Sources */,
|
||||
0A59C2701E3D01F400E40A2B /* OptionsViewController.swift in Sources */,
|
||||
0A59C26E1E3D01A700E40A2B /* WindowController.swift in Sources */,
|
||||
0A3153191CF37A660020DBB8 /* AppDelegate.swift in Sources */,
|
||||
0A59C2741E3D0C0E00E40A2B /* GetIt.swift in Sources */,
|
||||
0AF763CF1E474D2A00403BA1 /* InstallationGuideViewController.swift in Sources */,
|
||||
0AF763D41E47B90D00403BA1 /* InstallationGuideTexts.swift in Sources */,
|
||||
0AAAC76C208664EB009C6ACB /* progressView.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -327,19 +311,28 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
@@ -362,7 +355,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.12;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
@@ -374,19 +367,28 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
@@ -403,7 +405,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.12;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
@@ -421,7 +423,7 @@
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.KevinDeKoninck.GetIt;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -436,7 +438,7 @@
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.KevinDeKoninck.GetIt;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0820"
|
||||
LastUpgradeVersion = "1020"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict/>
|
||||
</plist>
|
||||
BIN
Binary file not shown.
@@ -35,21 +35,5 @@
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Get It/OptionsViewController.swift"
|
||||
timestampString = "508530891.185216"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "164"
|
||||
endingLineNumber = "164"
|
||||
landmarkName = "loadSettingsAndSetElements()"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
</Breakpoints>
|
||||
</Bucket>
|
||||
|
||||
@@ -23,11 +23,7 @@ class AboutViewController: NSViewController {
|
||||
}
|
||||
|
||||
@IBAction func githubBtnClicked(_ sender: Any) {
|
||||
open(website: "https://github.com/Kevin-De-Koninck/Get-It")
|
||||
}
|
||||
|
||||
@IBAction func kBtnClicked(_ sender: Any) {
|
||||
open(website: "https://kevindekoninck.com")
|
||||
open(website: "https://kevin-de-koninck.github.io/Get-It/")
|
||||
}
|
||||
|
||||
@IBAction func supportedSitesBtnClicked(_ sender: Any) {
|
||||
@@ -43,7 +39,7 @@ class AboutViewController: NSViewController {
|
||||
}
|
||||
|
||||
func open(website: String){
|
||||
if let url = URL(string: website), NSWorkspace.shared().open(url) {
|
||||
if let url = URL(string: website), NSWorkspace.shared.open(url) {
|
||||
print("default browser was successfully opened")
|
||||
}
|
||||
}
|
||||
|
||||
+272
-327
File diff suppressed because it is too large
Load Diff
@@ -10,14 +10,16 @@ import Foundation
|
||||
import Cocoa
|
||||
|
||||
// Command
|
||||
let DEFAULT_COMMAND = "export PATH=$PATH:/usr/local/bin && youtube-dl --prefer-ffmpeg --newline —yes-playlist —extract-audio —audio-format mp3 —audio-quality 5 —youtube-skip-dash-manifest —sub-format srt —max-filesize 15M —ignore-errors --no-colorhttps://www.youtube.com/watch?v=LrAx8ZuCFyU -o ~/Downloads/‘%(title)s.%(ext)s’"
|
||||
let EXPORT_PATH = "export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin"
|
||||
let DEFAULT_COMMAND = EXPORT_PATH + " && youtube-dl --prefer-ffmpeg --newline —yes-playlist —extract-audio —audio-format mp3 —audio-quality 5 —youtube-skip-dash-manifest —sub-format srt —ignore-errors --no-colorhttps://www.youtube.com/watch?v=LrAx8ZuCFyU -o ~/Downloads/‘%(title)s.%(ext)s’"
|
||||
let DEFAULT_OUTPUTPATH = "~/Downloads/"
|
||||
let REGEX_PATTERN = "(?<=^\\[download\\].)[0-9.]+\\%"
|
||||
|
||||
//Color
|
||||
var blueColor = NSColor.init(red: 45.0/255, green: 135.0/255, blue: 250.0/255, alpha: 1)
|
||||
|
||||
// Settings
|
||||
let DEFAULT_SETTINGS = [ "maxFileSize" : "15",
|
||||
let DEFAULT_SETTINGS = [ "maxFileSize" : "",
|
||||
"ignoreErrors" : "1", //bool
|
||||
"path" : "~/Downloads/",
|
||||
"outputTemplate" : "Title.extension",
|
||||
@@ -49,10 +51,5 @@ let DEFAULT_SETTINGS = [ "maxFileSize" : "15",
|
||||
// User Defaults - keys
|
||||
let SAVED_COMMAND = "savedCommand"
|
||||
let SETTINGS_KEY = "settings"
|
||||
let YTDL = "isYTDLInstalled"
|
||||
let BREW = "isBrewInstalled"
|
||||
let FFMPEG = "isFfmpegInstalled"
|
||||
let PYTHON = "isPythonInstalled"
|
||||
let XCODE = "isXcodeInstalled"
|
||||
let OUTPUT_PATH = "outputPath"
|
||||
let OUTPUT_TEMPLATE = "outputTemplate"
|
||||
|
||||
@@ -12,20 +12,20 @@ class DownloadButton: NSButton {
|
||||
|
||||
override func draw(_ dirtyRect: NSRect) {
|
||||
super.draw(dirtyRect)
|
||||
|
||||
self.layer?.backgroundColor = blueColor.cgColor
|
||||
self.layer?.cornerRadius = 15.0
|
||||
self.layer?.masksToBounds = true
|
||||
}
|
||||
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
|
||||
self.layer?.backgroundColor = blueColor.cgColor
|
||||
self.layer?.cornerRadius = 15.0
|
||||
self.layer?.masksToBounds = true
|
||||
|
||||
//text
|
||||
let style = NSMutableParagraphStyle()
|
||||
style.alignment = .center
|
||||
self.attributedTitle = NSAttributedString(string: "Download", attributes: [ NSForegroundColorAttributeName : NSColor.white,
|
||||
NSParagraphStyleAttributeName : style,
|
||||
NSFontAttributeName: NSFont(name: "Arial", size: 18)!])
|
||||
self.attributedTitle = NSAttributedString(string: "Download", attributes: [ NSAttributedString.Key.foregroundColor : NSColor.white,
|
||||
NSAttributedString.Key.paragraphStyle : style,
|
||||
NSAttributedString.Key.font: NSFont(name: "Arial", size: 18)!])
|
||||
}
|
||||
}
|
||||
|
||||
+4
-67
@@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import STPrivilegedTask
|
||||
|
||||
class GetIt {
|
||||
var isYTDLInstalled: Bool = false
|
||||
@@ -14,40 +15,7 @@ class GetIt {
|
||||
var isFfmpegInstalled: Bool = false
|
||||
var isPythonInstalled: Bool = false
|
||||
var isXcodeInstalled: Bool = false
|
||||
|
||||
init() {
|
||||
//Get installed software
|
||||
//This is needed for the installation guide
|
||||
if let installed = UserDefaults.standard.value(forKey: YTDL) as? String {
|
||||
self.isYTDLInstalled = installed == "true" ? true : false
|
||||
} else {
|
||||
self.isYTDLInstalled = false
|
||||
}
|
||||
|
||||
if let installed = UserDefaults.standard.value(forKey: BREW) as? String {
|
||||
self.isBrewInstalled = installed == "true" ? true : false
|
||||
} else {
|
||||
self.isBrewInstalled = false
|
||||
}
|
||||
|
||||
if let installed = UserDefaults.standard.value(forKey: FFMPEG) as? String {
|
||||
self.isFfmpegInstalled = installed == "true" ? true : false
|
||||
} else {
|
||||
self.isFfmpegInstalled = false
|
||||
}
|
||||
|
||||
if let installed = UserDefaults.standard.value(forKey: PYTHON) as? String {
|
||||
self.isPythonInstalled = installed == "true" ? true : false
|
||||
} else {
|
||||
self.isPythonInstalled = false
|
||||
}
|
||||
|
||||
if let installed = UserDefaults.standard.value(forKey: XCODE) as? String {
|
||||
self.isXcodeInstalled = installed == "true" ? true : false
|
||||
} else {
|
||||
self.isXcodeInstalled = false
|
||||
}
|
||||
}
|
||||
var isPycryptoInstalled: Bool = false
|
||||
|
||||
|
||||
func getCommand() -> String {
|
||||
@@ -83,7 +51,7 @@ class GetIt {
|
||||
func execute(commandSynchronous: String) -> String {
|
||||
var arguments:[String] = []
|
||||
arguments.append("-c")
|
||||
arguments.append( commandSynchronous )
|
||||
arguments.append( EXPORT_PATH + " && " + commandSynchronous + " 2>&1")
|
||||
|
||||
let task = Process()
|
||||
task.launchPath = "/bin/sh"
|
||||
@@ -96,38 +64,7 @@ class GetIt {
|
||||
task.waitUntilExit()
|
||||
let data = pipe.fileHandleForReading.readDataToEndOfFile()
|
||||
|
||||
return(NSString(data: data, encoding: String.Encoding.utf8.rawValue) as! String)
|
||||
}
|
||||
|
||||
|
||||
func checkIfSoftwareIsInstalled(){
|
||||
var result = self.execute(commandSynchronous: "export PATH=$PATH:/usr/local/bin && if brew ls --versions youtube-dl > /dev/null; then echo INSTALLED; else echo NOT INSTALLED; fi")
|
||||
var temp = result.components(separatedBy: "\n")
|
||||
isYTDLInstalled = temp[0] == "INSTALLED" ? true : false
|
||||
|
||||
result = self.execute(commandSynchronous: "export PATH=$PATH:/usr/local/bin && [ ! -f \"`which brew`\" ] && echo NOT INSTALLED")
|
||||
temp = result.components(separatedBy: "\n")
|
||||
isBrewInstalled = temp[0] == "NOT INSTALLED" ? false : true
|
||||
|
||||
result = self.execute(commandSynchronous: "export PATH=$PATH:/usr/local/bin && if brew ls --versions ffmpeg > /dev/null; then echo INSTALLED; else echo NOT INSTALLED; fi")
|
||||
temp = result.components(separatedBy: "\n")
|
||||
isFfmpegInstalled = temp[0] == "INSTALLED" ? true : false
|
||||
|
||||
result = self.execute(commandSynchronous: "export PATH=$PATH:/usr/local/bin && if brew ls --versions python3 > /dev/null; then echo INSTALLED; else echo NOT INSTALLED; fi")
|
||||
temp = result.components(separatedBy: "\n")
|
||||
isPythonInstalled = temp[0] == "INSTALLED" ? true : false
|
||||
|
||||
result = self.execute(commandSynchronous: "export PATH=$PATH:/usr/local/bin && [ ! -f \"`which xcode-select`\" ] && echo NOT INSTALLED")
|
||||
temp = result.components(separatedBy: "\n")
|
||||
isXcodeInstalled = temp[0] == "NOT INSTALLED" ? false : true
|
||||
|
||||
//save it so we can use it everywhere (installation guide)
|
||||
UserDefaults.standard.setValue("\(isBrewInstalled)", forKey: BREW)
|
||||
UserDefaults.standard.setValue("\(isYTDLInstalled)", forKey: YTDL)
|
||||
UserDefaults.standard.setValue("\(isFfmpegInstalled)", forKey: FFMPEG)
|
||||
UserDefaults.standard.setValue("\(isPythonInstalled)", forKey: PYTHON)
|
||||
UserDefaults.standard.setValue("\(isXcodeInstalled)", forKey: XCODE)
|
||||
UserDefaults.standard.synchronize()
|
||||
return(NSString(data: data, encoding: String.Encoding.utf8.rawValue)! as String)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
-3
@@ -17,17 +17,17 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.2</string>
|
||||
<string>0.7</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2</string>
|
||||
<string>69</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2017 Kevin De Koninck. All rights reserved.</string>
|
||||
<string>Copyright © 2019 Kevin De Koninck. All rights reserved.</string>
|
||||
<key>NSMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
//
|
||||
// InstallationGuideTexts.swift
|
||||
// Get It
|
||||
//
|
||||
// Created by Kevin De Koninck on 05/02/2017.
|
||||
// Copyright © 2017 Kevin De Koninck. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
let PAGES = ["intro","xcode","brew","python","ytdl","finish"]
|
||||
|
||||
let TITLE:[String:String] = ["intro":"Introduction",
|
||||
"xcode":"Xcode Command Line Tools",
|
||||
"brew":"Homebrew",
|
||||
"python":"Python interpreter",
|
||||
"ytdl":"YouTube-DL and other dependencies",
|
||||
"finish":"It's over now. It's done."]
|
||||
|
||||
let BODY:[String:String] = ["intro":"Before you can use Get It, we must install some dependencies. This guide will assist you with installing these dependencies.\n\nThe dependencies that we will install (if not already installed) are:\n - Homebrew\n - Python 3\n - YouTube-DL \n - FFMPEG.\n\n.",
|
||||
"xcode":"Xcode development tools are some handy tools that are always nice to have on your system. Xcode is a large suite of software development tools and libraries from Apple.\nInstallation of many common Unix-based tools requires the GCC compiler. The Xcode Command Line Tools include a GCC compiler.\n\nTo install the Xcode command line tools, just press the 'Install' button below and follow the guide that will pop up.",
|
||||
"brew":"Homebrew is the missing package manager for macOS which we'll be using Homebrew to install all the software that is needed for Get It.\n\nTo install brew, copy the following command (green text), press the button 'Open the Terminal app' and paste the command in the terminal app. Then press enter, wait a bit and press enter again. Enter your password when the installer asks for it.\nWhen the installation has finished, you may close the Terminal app.",
|
||||
"python":"Our core program requires the python 3 interpreter to operate.\n\nTo install Python 3, just press the 'Install' button below.",
|
||||
"ytdl":"YouTube-DL is the core program of Get It. It's an open-source command line tool that handles the downloading of our files.\nWe also want to install FFMPEG for post processing of our files (e.g. converting our audio to mp3).\n\nTo install YouTube-DL and FFMPEG, just press the 'Install' button below.",
|
||||
"finish":"If you executed eveything correctly, then your installation is completed. \n\nYou may close this window (and the Terminal app) now and click on the little blue refresh icon (like the one below) to reload all software.\n\nThen you're good to go!"]
|
||||
|
||||
let INSTALLATION_COMMANDS:[String:String] = ["intro":"",
|
||||
"xcode":"xcode-select --install",
|
||||
"brew":"/usr/bin/ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"",
|
||||
"python":"brew install python3",
|
||||
"ytdl":"brew install youtube-dl ffmpeg libav",
|
||||
"finish":""]
|
||||
@@ -1,155 +0,0 @@
|
||||
//
|
||||
// InstallationGuideViewController.swift
|
||||
// Get It
|
||||
//
|
||||
// Created by Kevin De Koninck on 05/02/2017.
|
||||
// Copyright © 2017 Kevin De Koninck. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import DJProgressHUD_OSX
|
||||
|
||||
class InstallationGuideViewController: NSViewController {
|
||||
|
||||
var getIt = GetIt()
|
||||
|
||||
/*
|
||||
* Dictoinary title ("intro" : "introduction", "brew" : "Homebrew", ...)
|
||||
bodyText ("intro : "welcome to ..." , "brew" : "we will ...", ...)
|
||||
...
|
||||
|
||||
* variabele page: Int = 0
|
||||
variable pages = ["intro", "brew", ...]
|
||||
|
||||
* bodytext = bodyTextDict(pages[page])
|
||||
|
||||
* if clicked previeous: page = page - 1 (if page > 0)
|
||||
|
||||
etc
|
||||
*/
|
||||
|
||||
@IBOutlet weak var nextPageBtn: NSButton!
|
||||
@IBOutlet weak var previousPageBtn: NSButton!
|
||||
@IBOutlet weak var bodyText: NSTextField!
|
||||
@IBOutlet weak var commandTextField: optionsTextfield!
|
||||
@IBOutlet weak var titleText: NSTextField!
|
||||
@IBOutlet weak var refreshImage: NSButton!
|
||||
@IBOutlet weak var openTerminalButton: NSButton!
|
||||
@IBOutlet weak var installButton: installButton!
|
||||
|
||||
var currentPage: Int = 0 //intro
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
self.view.wantsLayer = true
|
||||
|
||||
previousPageBtn.isHidden = true
|
||||
refreshImage.isHidden = true
|
||||
currentPage = 0
|
||||
displayPage()
|
||||
|
||||
//TODO remove
|
||||
//
|
||||
// print(getIt.isXcodeInstalled)
|
||||
// print(getIt.isBrewInstalled)
|
||||
// print(getIt.isPythonInstalled)
|
||||
// print(getIt.isYTDLInstalled)
|
||||
//
|
||||
getIt.isXcodeInstalled = false
|
||||
getIt.isPythonInstalled = false
|
||||
getIt.isBrewInstalled = false
|
||||
}
|
||||
|
||||
override func awakeFromNib() {
|
||||
if self.view.layer != nil {
|
||||
let color : CGColor = CGColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)
|
||||
self.view.layer?.backgroundColor = color
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func displayPage() {
|
||||
installButton.isEnabled = true
|
||||
switch currentPage {
|
||||
case 0:
|
||||
previousPageBtn.isHidden = true
|
||||
nextPageBtn.isHidden = false
|
||||
commandTextField.isHidden = true
|
||||
refreshImage.isHidden = true
|
||||
openTerminalButton.isHidden = true
|
||||
installButton.isHidden = true
|
||||
case 2:
|
||||
previousPageBtn.isHidden = false
|
||||
nextPageBtn.isHidden = false
|
||||
commandTextField.isHidden = false
|
||||
refreshImage.isHidden = true
|
||||
openTerminalButton.isHidden = false
|
||||
installButton.isHidden = true
|
||||
case 5:
|
||||
previousPageBtn.isHidden = false
|
||||
nextPageBtn.isHidden = true
|
||||
commandTextField.isHidden = true
|
||||
refreshImage.isHidden = false
|
||||
openTerminalButton.isHidden = true
|
||||
installButton.isHidden = true
|
||||
default:
|
||||
previousPageBtn.isHidden = false
|
||||
nextPageBtn.isHidden = false
|
||||
commandTextField.isHidden = true
|
||||
refreshImage.isHidden = true
|
||||
openTerminalButton.isHidden = true
|
||||
installButton.isHidden = false
|
||||
}
|
||||
|
||||
titleText.stringValue = TITLE[PAGES[currentPage]]!
|
||||
bodyText.stringValue = BODY[PAGES[currentPage]]!
|
||||
commandTextField.stringValue = INSTALLATION_COMMANDS[PAGES[currentPage]]!
|
||||
}
|
||||
@IBAction func openTerminalButtonClicked(_ sender: Any) {
|
||||
_ = getIt.execute(commandSynchronous: "open /Applications/Utilities/Terminal.app")
|
||||
}
|
||||
|
||||
@IBAction func installBtnClicked(_ sender: Any) {
|
||||
var cmd = ""
|
||||
|
||||
switch currentPage {
|
||||
case 1: cmd = "export PATH=$PATH:/usr/local/bin && " + INSTALLATION_COMMANDS["xcode"]!
|
||||
case 3: cmd = "export PATH=$PATH:/usr/local/bin && " + INSTALLATION_COMMANDS["python"]!
|
||||
default: cmd = "export PATH=$PATH:/usr/local/bin && " + INSTALLATION_COMMANDS["ytdl"]!
|
||||
}
|
||||
|
||||
DJProgressHUD.showStatus(" Installing\nPlease wait...", from: self.view)
|
||||
_ = getIt.execute(commandSynchronous: cmd)
|
||||
DJProgressHUD.dismiss()
|
||||
installButton.isEnabled = false
|
||||
}
|
||||
|
||||
@IBAction func nextPageBtnClicked(_ sender: Any) {
|
||||
|
||||
if(currentPage == 0 && getIt.isXcodeInstalled && getIt.isBrewInstalled && getIt.isPythonInstalled) { currentPage = 4 }
|
||||
else if(currentPage == 0 && getIt.isXcodeInstalled && getIt.isBrewInstalled) { currentPage = 3 }
|
||||
else if(currentPage == 0 && getIt.isXcodeInstalled) { currentPage = 2 }
|
||||
else if(currentPage == 1 && getIt.isBrewInstalled && getIt.isPythonInstalled) { currentPage = 4 }
|
||||
else if(currentPage == 1 && getIt.isBrewInstalled) { currentPage = 3 }
|
||||
else if(currentPage == 2 && getIt.isPythonInstalled) { currentPage = 4 }
|
||||
else{ currentPage = currentPage + 1 }
|
||||
|
||||
displayPage()
|
||||
}
|
||||
|
||||
@IBAction func previousPageBtnClicked(_ sender: Any) {
|
||||
|
||||
if(currentPage == 4 && getIt.isXcodeInstalled && getIt.isBrewInstalled && getIt.isPythonInstalled) { currentPage = 0 }
|
||||
else if(currentPage == 4 && getIt.isPythonInstalled && getIt.isBrewInstalled) { currentPage = 1 }
|
||||
else if(currentPage == 4 && getIt.isPythonInstalled) { currentPage = 2 }
|
||||
else if(currentPage == 3 && getIt.isXcodeInstalled && getIt.isBrewInstalled) { currentPage = 0 }
|
||||
else if(currentPage == 3 && getIt.isBrewInstalled) { currentPage = 1 }
|
||||
else if(currentPage == 2 && getIt.isXcodeInstalled) { currentPage = 0 }
|
||||
else{ currentPage = currentPage - 1 }
|
||||
|
||||
displayPage()
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// Logger.swift
|
||||
// Get It
|
||||
//
|
||||
// Created by Kevin De Koninck on 16/05/2018.
|
||||
// Copyright © 2018 Kevin De Koninck. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
class Logger {
|
||||
let log_file: String = "/tmp/getit_logs"
|
||||
let install_log_file: String = "/tmp/getit_install"
|
||||
|
||||
func reset() {
|
||||
let cmd = "echo '' > \(self.log_file)"
|
||||
_ = self.execute(commandSynchronous: cmd)
|
||||
}
|
||||
|
||||
func log(tag: String, str: String) {
|
||||
print("\(tag) \(str)")
|
||||
let str_ = str.replacingOccurrences(of: "'", with: "")
|
||||
var cmd = "echo '\(tag)\t\(str_)' >> \(self.log_file)"
|
||||
cmd = cmd.replacingOccurrences(of: "\"", with: "")
|
||||
cmd = cmd.replacingOccurrences(of: "`", with: "")
|
||||
_ = self.execute(commandSynchronous: cmd)
|
||||
}
|
||||
|
||||
func resetInstallLog() {
|
||||
let cmd = "echo '' > \(self.install_log_file)"
|
||||
_ = self.execute(commandSynchronous: cmd)
|
||||
}
|
||||
|
||||
func logInstall(tag: String, str: String) {
|
||||
print("\(tag) \(str)")
|
||||
let str_ = str.replacingOccurrences(of: "'", with: "")
|
||||
var cmd = "echo '\(tag)\t\(str_)' >> \(self.install_log_file)"
|
||||
cmd = cmd.replacingOccurrences(of: "\"", with: "")
|
||||
cmd = cmd.replacingOccurrences(of: "`", with: "")
|
||||
_ = self.execute(commandSynchronous: cmd)
|
||||
}
|
||||
|
||||
func execute(commandSynchronous: String) -> String {
|
||||
var arguments:[String] = []
|
||||
arguments.append("-c")
|
||||
arguments.append( EXPORT_PATH + " && " + commandSynchronous + " 2>&1")
|
||||
|
||||
let task = Process()
|
||||
task.launchPath = "/bin/sh"
|
||||
task.arguments = arguments
|
||||
|
||||
let pipe = Pipe()
|
||||
task.standardOutput = pipe
|
||||
task.standardError = pipe
|
||||
task.launch()
|
||||
task.waitUntilExit()
|
||||
let data = pipe.fileHandleForReading.readDataToEndOfFile()
|
||||
|
||||
return(NSString(data: data, encoding: String.Encoding.utf8.rawValue)! as String)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,8 @@ import Cocoa
|
||||
import ITSwitch
|
||||
|
||||
class OptionsViewController: NSViewController {
|
||||
|
||||
var getIt = GetIt()
|
||||
|
||||
//General tab
|
||||
@IBOutlet weak var maxFileSize: NSTextField!
|
||||
@@ -17,6 +19,8 @@ class OptionsViewController: NSViewController {
|
||||
@IBOutlet weak var outputTemplate: NSPopUpButton!
|
||||
@IBOutlet weak var selectedPath: NSTextField!
|
||||
|
||||
@IBOutlet var installProgressView: progressView!
|
||||
@IBOutlet weak var installProgressText: NSTextField!
|
||||
|
||||
//audio tab
|
||||
@IBOutlet weak var extractAudio: ITSwitch!
|
||||
@@ -71,6 +75,10 @@ class OptionsViewController: NSViewController {
|
||||
downloadPlaylist.tintColor = blueColor
|
||||
reversePlaylist.tintColor = blueColor
|
||||
netrc.tintColor = blueColor
|
||||
|
||||
// progress view
|
||||
installProgressView.isHidden = true
|
||||
installProgressText.isHidden = true
|
||||
|
||||
//placeholders
|
||||
maxFileSize.placeholderString = "In MB"
|
||||
@@ -112,6 +120,15 @@ class OptionsViewController: NSViewController {
|
||||
UserDefaults.standard.synchronize()
|
||||
}
|
||||
|
||||
|
||||
@IBAction func installSoftwareBtnClicked(_ sender: Any) {
|
||||
installProgressView.isHidden = false
|
||||
installProgressText.isHidden = false
|
||||
_ = getIt.execute(commandSynchronous: "if ! xcode-select -v &> /dev/null; then xcode-select --install; fi; if brew -v &> /dev/null; then brew update; else echo /usr/bin/ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'; fi; if brew ls --versions python &> /dev/null; then brew upgrade python; else brew install python; brew link python; fi; if brew ls --versions python3 &> /dev/null; then brew upgrade python3; else brew install python3; fi; if pip2.7 list | grep -i pycrypt &> /dev/null; then pip2.7 install pycrypt --upgrade; else pip2.7 install pycrypt; fi; if youtube-dl --version &> /dev/null; then brew upgrade youtube-dl; else brew install youtube-dl; fi; if brew list libav &> /dev/null; then brew upgrade libav; else brew install libav; fi; if brew list ffmpeg &> /dev/null; then brew upgrade ffmpeg; else brew install ffmpeg; fi")
|
||||
installProgressView.isHidden = true
|
||||
installProgressText.isHidden = true
|
||||
}
|
||||
|
||||
@IBAction func loadDefaultsBtnClicked(_ sender: Any) {
|
||||
UserDefaults.standard.set(DEFAULT_SETTINGS, forKey: SETTINGS_KEY)
|
||||
UserDefaults.standard.setValue(DEFAULT_SETTINGS["path"]!, forKey: OUTPUT_PATH)
|
||||
@@ -122,7 +139,7 @@ class OptionsViewController: NSViewController {
|
||||
func saveSettings() {
|
||||
var settingsDict = [String: String]()
|
||||
|
||||
settingsDict["maxFileSize"] = maxFileSize.stringValue
|
||||
settingsDict["maxFileSize"] = maxFileSize.stringValue.replacingOccurrences(of: ".", with: "").replacingOccurrences(of: ",", with: "")
|
||||
settingsDict["ignoreErrors"] = String(ignoreErrors.checked) == "true" ? "1" : "0"
|
||||
settingsDict["path"] = UserDefaults.standard.value(forKey: OUTPUT_PATH) as? String
|
||||
settingsDict["outputTemplate"] = outputTemplate.itemTitle(at: outputTemplate.indexOfSelectedItem)
|
||||
@@ -159,9 +176,16 @@ class OptionsViewController: NSViewController {
|
||||
if let arr = UserDefaults.standard.value(forKey: SETTINGS_KEY) as? [String:String] {
|
||||
|
||||
|
||||
//Get and set all saved settings
|
||||
|
||||
if arr["path"] != nil { selectedPath.stringValue = NSURL(fileURLWithPath: (UserDefaults.standard.value(forKey: OUTPUT_PATH) as! String)).lastPathComponent! }
|
||||
//Get and set all saved settings
|
||||
if arr["path"] != nil {
|
||||
if let temp = UserDefaults.standard.value(forKey: OUTPUT_PATH) as? String {
|
||||
selectedPath.stringValue = NSURL(fileURLWithPath: temp).lastPathComponent!
|
||||
} else { // BUG FIX
|
||||
UserDefaults.standard.setValue(DEFAULT_OUTPUTPATH, forKey: OUTPUT_PATH)
|
||||
UserDefaults.standard.synchronize()
|
||||
selectedPath.stringValue = NSURL(fileURLWithPath: DEFAULT_OUTPUTPATH).lastPathComponent!
|
||||
}
|
||||
}
|
||||
else { selectedPath.stringValue = DEFAULT_SETTINGS["path"]! }
|
||||
|
||||
if let val = arr["maxFileSize"] { maxFileSize.stringValue = val }
|
||||
@@ -252,13 +276,13 @@ class OptionsViewController: NSViewController {
|
||||
|
||||
func createCommand() -> String {
|
||||
//Start of creating the command
|
||||
var command = "export PATH=$PATH:/usr/local/bin && youtube-dl --newline --prefer-ffmpeg";
|
||||
var command = EXPORT_PATH + " && youtube-dl --newline --prefer-ffmpeg";
|
||||
|
||||
//Preprocessing
|
||||
let audioFormatString = audioFormat.selectedItem?.title.characters.split{$0 == "\""}.map(String.init)
|
||||
let audioQualityString = audioQuality.selectedItem!.title.characters.split{$0 == "\""}.map(String.init)
|
||||
let audioFormatString = audioFormat.selectedItem?.title.split{$0 == "\""}.map(String.init)
|
||||
let audioQualityString = audioQuality.selectedItem!.title.split{$0 == "\""}.map(String.init)
|
||||
let videoFormatString = videoFormat.selectedItem!.tag
|
||||
let audioQ = audioQualityString.first!.characters.first
|
||||
let audioQ = audioQualityString.first!.first
|
||||
|
||||
//Creating the command
|
||||
if downloadPlaylist.checked { command += " --yes-playlist" } else { command += " --no-playlist" }
|
||||
@@ -281,7 +305,7 @@ class OptionsViewController: NSViewController {
|
||||
if downloadAutoSubs.checked { command += " --write-auto-sub" }
|
||||
if downloadAllSubs.checked { command += " --all-subs" }
|
||||
if embedSubs.checked { command += " --embed-subs" }
|
||||
if !maxFileSize.stringValue.isEmpty { command += " --max-filesize \(maxFileSize.stringValue)M" }
|
||||
if !maxFileSize.stringValue.isEmpty { command += " --max-filesize \(maxFileSize.stringValue.replacingOccurrences(of: ".", with: "").replacingOccurrences(of: ",", with: ""))M" }
|
||||
if ignoreErrors.checked == true { command += " --ignore-errors" } else { command += " --abort-on-error" }
|
||||
|
||||
command += " --audio-format \(audioFormatString![0])"
|
||||
@@ -320,19 +344,14 @@ class OptionsViewController: NSViewController {
|
||||
dialog.canCreateDirectories = true
|
||||
dialog.allowsMultipleSelection = false
|
||||
|
||||
if (dialog.runModal() == NSModalResponseOK) {
|
||||
if (dialog.runModal() == NSApplication.ModalResponse.OK) {
|
||||
let result = dialog.url
|
||||
if (result != nil) {
|
||||
let path = result!.path
|
||||
UserDefaults.standard.setValue(path, forKey: OUTPUT_PATH)
|
||||
UserDefaults.standard.synchronize()
|
||||
|
||||
|
||||
|
||||
selectedPath.stringValue = NSURL(fileURLWithPath: path).lastPathComponent!
|
||||
|
||||
print(path)
|
||||
print(selectedPath.stringValue)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+55
-68
@@ -10,15 +10,10 @@
|
||||
//TODO: check if youtube-dl is installed on boot up: if brew ls --versions youtube-dl > /dev/null; then echo INSTALLED; else echo NOT INSTALLED; fi
|
||||
// if not, then disable all buttons except the package icon that will start a guide on how to install it.
|
||||
|
||||
//TODO: check if homebrew is installed: [ ! -f "`which breww`" ] && echo NOT INSTALLED (check on output: NOT INSTALLED)
|
||||
|
||||
//TODO: make a guide
|
||||
|
||||
//TODO: regex check for urls in input field
|
||||
|
||||
|
||||
import Cocoa
|
||||
import DJProgressHUD_OSX
|
||||
|
||||
class ViewController: NSViewController {
|
||||
|
||||
@@ -26,19 +21,19 @@ class ViewController: NSViewController {
|
||||
@IBOutlet weak var settingsBtn: NSButton!
|
||||
@IBOutlet weak var openDestinationFolderBtn: GrayButton!
|
||||
@IBOutlet weak var downloadBtn: DownloadButton!
|
||||
@IBOutlet weak var installationGuideBtn: NSButton!
|
||||
@IBOutlet weak var refreshInstallationBtn: NSButton!
|
||||
@IBOutlet weak var progressV: progressView!
|
||||
@IBOutlet weak var progressTitle: NSTextField!
|
||||
@IBOutlet weak var progressDetails: NSTextField!
|
||||
|
||||
|
||||
//global variables
|
||||
var getIt = GetIt()
|
||||
var logger = Logger()
|
||||
var downloadingFileNr: Int = 1
|
||||
var previousProgress: CGFloat = 0.0
|
||||
var currentProgress: CGFloat = 0.0
|
||||
var downloadsDidStart: Bool = false
|
||||
|
||||
|
||||
|
||||
override func awakeFromNib() {
|
||||
if self.view.layer != nil {
|
||||
let color : CGColor = CGColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)
|
||||
@@ -52,75 +47,75 @@ class ViewController: NSViewController {
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(openSettingsView), name: NSNotification.Name(rawValue: "openSettingsView"), object: nil)
|
||||
}
|
||||
func openSettingsView(notif: AnyObject) {
|
||||
@objc func openSettingsView(notif: AnyObject) {
|
||||
self.performSegue(withIdentifier: "settingsSegue", sender: self)
|
||||
}
|
||||
|
||||
override func viewWillAppear() {
|
||||
super.viewWillAppear()
|
||||
|
||||
getIt.checkIfSoftwareIsInstalled()
|
||||
let activate = (!getIt.isYTDLInstalled) || (!getIt.isFfmpegInstalled)
|
||||
installationGuideViewSetUp(activate: activate)
|
||||
installationGuideViewSetUp(activate: true) //TODO - remove (is for testing purposes)
|
||||
dismissProgressView()
|
||||
}
|
||||
|
||||
func installationGuideViewSetUp(activate: Bool) {
|
||||
inputURLS.isEditable = !activate
|
||||
settingsBtn.isEnabled = !activate
|
||||
openDestinationFolderBtn.isEnabled = !activate
|
||||
downloadBtn.isEnabled = !activate
|
||||
installationGuideBtn.isEnabled = activate
|
||||
installationGuideBtn.isHidden = !activate
|
||||
refreshInstallationBtn.isEnabled = activate
|
||||
refreshInstallationBtn.isHidden = !activate
|
||||
func activateComponents(activate: Bool) {
|
||||
inputURLS.isEditable = activate
|
||||
settingsBtn.isEnabled = activate
|
||||
openDestinationFolderBtn.isEnabled = activate
|
||||
downloadBtn.isEnabled = activate
|
||||
}
|
||||
|
||||
@IBAction func refreshInstallationBtnClicked(_ sender: Any) {
|
||||
getIt.checkIfSoftwareIsInstalled()
|
||||
let activate = (!getIt.isYTDLInstalled) || (!getIt.isFfmpegInstalled)
|
||||
installationGuideViewSetUp(activate: activate)
|
||||
// installationGuideViewSetUp(activate: true) //TODO - remove (is for testing purposes)
|
||||
func dismissProgressView() {
|
||||
self.activateComponents(activate: true)
|
||||
progressV.isHidden = true
|
||||
progressTitle.isHidden = true
|
||||
progressDetails.isHidden = true
|
||||
}
|
||||
|
||||
@IBAction func InstallGuideBtnClicked(_ sender: Any) {
|
||||
func showInProgressView(title: String, details: String) {
|
||||
self.activateComponents(activate: false)
|
||||
progressV.isHidden = false
|
||||
progressTitle.isHidden = false
|
||||
progressDetails.isHidden = false
|
||||
progressTitle.stringValue = title
|
||||
progressDetails.stringValue = details
|
||||
logger.log(tag: "[PROGRESS VIEW]", str: "\(title): \(details)")
|
||||
}
|
||||
|
||||
@IBAction func openDestinationFolderBtnClicked(_ sender: Any) {
|
||||
_ = getIt.open(folder: UserDefaults.standard.value(forKey: OUTPUT_PATH) as! String)
|
||||
}
|
||||
|
||||
|
||||
@IBAction func downloadButton(_ sender: AnyObject) {
|
||||
logger.reset()
|
||||
|
||||
//get input URLs
|
||||
let tempString = inputURLS.string!
|
||||
let urls = tempString.characters.split{$0 == "\n"}.map(String.init)
|
||||
let tempString = inputURLS.string
|
||||
let urls = tempString.split{$0 == "\n"}.map(String.init)
|
||||
if(urls.count > 0){
|
||||
var urlStr = " "
|
||||
for url in urls { urlStr = urlStr + url + " " }
|
||||
|
||||
//start download
|
||||
downloadsDidStart = false
|
||||
DJProgressHUD.showStatus("Gathering information\n Please wait", from: self.view)
|
||||
self.showInProgressView(title: "Gathering information", details: "Please wait")
|
||||
execute(commmandAsynchronous: getIt.getCommand() + " -o " + getIt.getOutputPath() + getIt.getOutputTemplate() + urlStr)
|
||||
} else {
|
||||
DJProgressHUD.showStatus("Can't download nothing", from: self.view)
|
||||
self.showInProgressView(title: "Whoops", details: "Can't download nothing")
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(2), execute: {
|
||||
DJProgressHUD.dismiss()
|
||||
self.dismissProgressView()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func execute(commmandAsynchronous: String){
|
||||
|
||||
var receivedStr = "" // variable to keep the received string (usefull to display it at the end)
|
||||
downloadingFileNr = 1 // reset file nr
|
||||
|
||||
//Prepare command
|
||||
var arguments:[String] = []
|
||||
arguments.append("-c")
|
||||
arguments.append( commmandAsynchronous )
|
||||
print( commmandAsynchronous )
|
||||
arguments.append(commmandAsynchronous + " 2>&1")
|
||||
logger.log(tag: "[COMMAND]", str: "\(commmandAsynchronous) 2>&1")
|
||||
|
||||
//Start execution of command
|
||||
let task = Process()
|
||||
@@ -138,35 +133,30 @@ class ViewController: NSViewController {
|
||||
if data.count > 0 {
|
||||
if let s = NSString(data: data, encoding: String.Encoding.utf8.rawValue) {
|
||||
//RECEIVED OUTPUT
|
||||
|
||||
print("RECEIVED \(s)")
|
||||
print("--------------")
|
||||
self.logger.log(tag: "[RECEIVED]", str: "\(s)")
|
||||
|
||||
var status: String!
|
||||
let matchesError = [String]()
|
||||
|
||||
//Received value preprocessing
|
||||
let receivedStr = s.components(separatedBy: "\n")[0]
|
||||
receivedStr = s.components(separatedBy: "\n")[0]
|
||||
var str = receivedStr.replacingOccurrences(of: " ", with: "")
|
||||
|
||||
//Get percentage using a regular expression
|
||||
do{
|
||||
//regex for downloadbar
|
||||
let regex = try NSRegularExpression(pattern: REGEX_PATTERN, options: [])
|
||||
let matches = regex.matches(in: str, options: [], range: NSRange(location: 0, length: str.characters.count))
|
||||
let matches = regex.matches(in: str, options: [], range: NSRange(location: 0, length: str.count))
|
||||
//regex for error
|
||||
let regexError = try NSRegularExpression(pattern: "ERROR", options: [])
|
||||
let matchesError = regexError.matches(in: str, options: [], range: NSRange(location: 0, length: str.characters.count))
|
||||
_ = regexError.matches(in: str, options: [], range: NSRange(location: 0, length: str.count))
|
||||
|
||||
if matchesError.count > 0 {
|
||||
print(receivedStr)
|
||||
|
||||
}else if matches.count > 0 {
|
||||
let rangeOfMatch = matches[0].rangeAt(0)
|
||||
if matches.count > 0 {
|
||||
let rangeOfMatch = matches[0].range(at: 0)
|
||||
var index = str.index(str.startIndex, offsetBy: rangeOfMatch.location + rangeOfMatch.length - 1)
|
||||
str = str.substring(to: index)
|
||||
str = String(str[..<index])
|
||||
index = str.index(str.startIndex, offsetBy: rangeOfMatch.location - 1)
|
||||
str = str.substring(from: index)
|
||||
str = String(str[index...])
|
||||
|
||||
self.currentProgress = CGFloat(Double(round(100 * (str as NSString).doubleValue) / 100 ))
|
||||
if( self.currentProgress < self.previousProgress){
|
||||
@@ -184,39 +174,37 @@ class ViewController: NSViewController {
|
||||
if matchesError.count == 0 {
|
||||
if(str == "100"){
|
||||
self.downloadingFileNr = self.downloadingFileNr + 1
|
||||
status = "Processing file \(self.downloadingFileNr)\n \(self.currentProgress)%"
|
||||
status = "Processing file \(self.downloadingFileNr)"
|
||||
self.previousProgress = 0.0
|
||||
} else if (str == "-1" && self.downloadingFileNr > 1){
|
||||
status = "Processing file \(self.downloadingFileNr - 1)\n "
|
||||
status = "Processing file \(self.downloadingFileNr - 1)"
|
||||
} else if (str == "-1") {
|
||||
status = "Downloading file \(self.downloadingFileNr)\n \(self.currentProgress)%"
|
||||
status = "Downloading file \(self.downloadingFileNr)"
|
||||
} else if (self.currentProgress <= 100){
|
||||
status = "Downloading file \(self.downloadingFileNr)\n \(self.currentProgress)%"
|
||||
status = "Downloading file \(self.downloadingFileNr)"
|
||||
self.previousProgress = self.currentProgress
|
||||
self.downloadsDidStart = true
|
||||
} else {
|
||||
status = "Processing file \(self.downloadingFileNr)\n \(self.currentProgress)%"
|
||||
status = "Processing file \(self.downloadingFileNr)"
|
||||
self.previousProgress = self.currentProgress
|
||||
}
|
||||
if(self.downloadsDidStart) {
|
||||
DJProgressHUD.showProgress(self.currentProgress/100.0, withStatus: status, from: self.view)
|
||||
self.showInProgressView(title: status, details: "\(self.currentProgress)%")
|
||||
}
|
||||
}
|
||||
//error received
|
||||
else
|
||||
{
|
||||
DJProgressHUD.showStatus("ERROR\n\(receivedStr)", from: self.view)
|
||||
else {
|
||||
self.showInProgressView(title: "Error!", details: "\(receivedStr)")
|
||||
}
|
||||
}
|
||||
outHandle.waitForDataInBackgroundAndNotify()
|
||||
} else {
|
||||
//EOF ON STDOUT FROM PROCESS
|
||||
NotificationCenter.default.removeObserver(obs1)
|
||||
NotificationCenter.default.removeObserver(obs1 as Any)
|
||||
if(self.downloadingFileNr < 2){
|
||||
DJProgressHUD.dismiss()
|
||||
DJProgressHUD.showStatus(" Download failed\n\n Video not available or\nvideo format not available", from: self.view)
|
||||
self.showInProgressView(title: "Failed...", details: "Something went wrong. Please try other settings or report this issue on github if the problem doesn't magically disappears.")
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(4), execute: {
|
||||
DJProgressHUD.dismiss()
|
||||
self.dismissProgressView()
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -225,9 +213,8 @@ class ViewController: NSViewController {
|
||||
var obs2 : NSObjectProtocol!
|
||||
obs2 = NotificationCenter.default.addObserver(forName: Process.didTerminateNotification, object: task, queue: nil) { notification -> Void in
|
||||
//PROCESS TERMINATED
|
||||
NotificationCenter.default.removeObserver(obs2)
|
||||
|
||||
DJProgressHUD.dismiss()
|
||||
NotificationCenter.default.removeObserver(obs2 as Any)
|
||||
self.dismissProgressView()
|
||||
}
|
||||
|
||||
task.launch()
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
//
|
||||
// installationGuideTextField.swift
|
||||
// Get It
|
||||
//
|
||||
// Created by Kevin De Koninck on 05/02/2017.
|
||||
// Copyright © 2017 Kevin De Koninck. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class installationGuideTextField: NSTextField {
|
||||
|
||||
override func draw(_ dirtyRect: NSRect) {
|
||||
super.draw(dirtyRect)
|
||||
|
||||
var bgColor = NSColor(red: 251/255.0, green: 251/255.0, blue: 251/255.0, alpha: 1.0)
|
||||
bgColor = NSColor(red: 255/255.0, green: 255/255.0, blue: 255/255.0, alpha: 1.0)
|
||||
|
||||
self.focusRingType = .none
|
||||
self.isBordered = false
|
||||
self.drawsBackground = false
|
||||
self.backgroundColor = bgColor
|
||||
self.layer?.backgroundColor = bgColor.cgColor
|
||||
|
||||
//underline
|
||||
let border = CALayer()
|
||||
let width = CGFloat(1.0)
|
||||
border.borderColor = blueColor.cgColor
|
||||
border.frame = CGRect(x: 0, y: self.frame.size.height - width, width: self.frame.size.width, height: self.frame.size.height)
|
||||
border.borderWidth = width
|
||||
self.layer?.addSublayer(border)
|
||||
self.layer?.masksToBounds = true
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,20 +12,20 @@ class installButton: NSButton {
|
||||
|
||||
override func draw(_ dirtyRect: NSRect) {
|
||||
super.draw(dirtyRect)
|
||||
|
||||
self.layer?.backgroundColor = blueColor.cgColor
|
||||
self.layer?.cornerRadius = 15.0
|
||||
self.layer?.masksToBounds = true
|
||||
}
|
||||
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
|
||||
self.layer?.backgroundColor = blueColor.cgColor
|
||||
self.layer?.cornerRadius = 15.0
|
||||
self.layer?.masksToBounds = true
|
||||
|
||||
//text
|
||||
let style = NSMutableParagraphStyle()
|
||||
style.alignment = .center
|
||||
self.attributedTitle = NSAttributedString(string: "Install", attributes: [ NSForegroundColorAttributeName : NSColor.white,
|
||||
NSParagraphStyleAttributeName : style,
|
||||
NSFontAttributeName: NSFont(name: "Arial", size: 18)!])
|
||||
self.attributedTitle = NSAttributedString(string: "Install", attributes: [ NSAttributedString.Key.foregroundColor : NSColor.white,
|
||||
NSAttributedString.Key.paragraphStyle : style,
|
||||
NSAttributedString.Key.font: NSFont(name: "Arial", size: 18)!])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// progressView.swift
|
||||
// Get It
|
||||
//
|
||||
// Created by Kevin De Koninck on 17/04/2018.
|
||||
// Copyright © 2018 Kevin De Koninck. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class progressView: NSView {
|
||||
|
||||
override func draw(_ dirtyRect: NSRect) {
|
||||
super.draw(dirtyRect)
|
||||
|
||||
self.alphaValue = 0.7
|
||||
self.layer?.backgroundColor = NSColor.black.cgColor
|
||||
self.layer?.cornerRadius = 15.0
|
||||
self.layer?.masksToBounds = true
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
target ‘Get It’ do
|
||||
use_frameworks!
|
||||
pod 'ITSwitch'
|
||||
pod 'DJProgressHUD_OSX'
|
||||
pod 'STPrivilegedTask'
|
||||
pod 'LetsMove'
|
||||
end
|
||||
end
|
||||
|
||||
+13
-7
@@ -1,18 +1,24 @@
|
||||
PODS:
|
||||
- DJProgressHUD_OSX (0.0.1)
|
||||
- ITSwitch (1.0)
|
||||
- LetsMove (1.22)
|
||||
- LetsMove (1.24)
|
||||
- STPrivilegedTask (1.0.1)
|
||||
|
||||
DEPENDENCIES:
|
||||
- DJProgressHUD_OSX
|
||||
- ITSwitch
|
||||
- LetsMove
|
||||
- STPrivilegedTask
|
||||
|
||||
SPEC REPOS:
|
||||
https://github.com/cocoapods/specs.git:
|
||||
- ITSwitch
|
||||
- LetsMove
|
||||
- STPrivilegedTask
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
DJProgressHUD_OSX: a8de6d2da8750dbf671fcddc649a44a9cd2807c4
|
||||
ITSwitch: 7ff745d6f2a6910e9194b23e4eab9a843258a478
|
||||
LetsMove: 407d4d14815e6dc1549b6a9fe8e4b0f6aed3e305
|
||||
LetsMove: fefe56bc7bc7fb7d37049e28a14f297961229fc5
|
||||
STPrivilegedTask: 103f97827454e786074640cf89d303be344498c7
|
||||
|
||||
PODFILE CHECKSUM: b1b05df537f199f1410c30e64c24cde88db79221
|
||||
PODFILE CHECKSUM: 4dca32d4d6791341e27820d98c0efe1419299b51
|
||||
|
||||
COCOAPODS: 1.2.0
|
||||
COCOAPODS: 1.7.0.rc.1
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// DJProgressIndicator.h
|
||||
// Playground
|
||||
//
|
||||
// Created by Daniel Jackson on 5/11/14.
|
||||
// Copyright (c) 2014 Daniel Jackson. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface DJActivityIndicator : NSView
|
||||
|
||||
@property BOOL isAnimating;
|
||||
|
||||
- (void)setColor:(NSColor *)value;
|
||||
- (void)setBackgroundColor:(NSColor *)value;
|
||||
|
||||
- (void)stopAnimation:(id)sender;
|
||||
- (void)startAnimation:(id)sender;
|
||||
|
||||
@end
|
||||
@@ -1,208 +0,0 @@
|
||||
//
|
||||
// DJProgressIndicator.m
|
||||
// Playground
|
||||
//
|
||||
// Created by Daniel Jackson on 5/11/14.
|
||||
// Copyright (c) 2014 Daniel Jackson. All rights reserved.
|
||||
//
|
||||
|
||||
#import "DJActivityIndicator.h"
|
||||
|
||||
#define kAlphaWhenStopped 0.15
|
||||
#define kFadeMultiplier 0.85
|
||||
|
||||
@interface DJActivityIndicator ()
|
||||
{
|
||||
int position;
|
||||
NSMutableArray* finColors;
|
||||
|
||||
BOOL isFadingOut;
|
||||
NSTimer* animationTimer;
|
||||
|
||||
NSColor* foreColor;
|
||||
NSColor* backColor;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation DJActivityIndicator
|
||||
|
||||
- (id)initWithFrame:(NSRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
position = 0;
|
||||
int numFins = 12;
|
||||
|
||||
finColors = [[NSMutableArray alloc] initWithCapacity:numFins];
|
||||
|
||||
_isAnimating = NO;
|
||||
isFadingOut = NO;
|
||||
|
||||
foreColor = [NSColor blackColor];
|
||||
backColor = [NSColor clearColor];
|
||||
|
||||
for(int i=0; i<numFins; i++)
|
||||
{
|
||||
[finColors addObject:foreColor];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)drawRect:(NSRect)dirtyRect
|
||||
{
|
||||
[super drawRect:dirtyRect];
|
||||
|
||||
NSSize size = [self bounds].size;
|
||||
CGFloat theMaxSize;
|
||||
if(size.width >= size.height)
|
||||
theMaxSize = size.height;
|
||||
else
|
||||
theMaxSize = size.width;
|
||||
|
||||
[backColor set];
|
||||
[NSBezierPath fillRect:[self bounds]];
|
||||
|
||||
CGContextRef currentContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
|
||||
[NSGraphicsContext saveGraphicsState];
|
||||
|
||||
CGContextTranslateCTM(currentContext,[self bounds].size.width/2,[self bounds].size.height/2);
|
||||
|
||||
NSBezierPath *path = [[NSBezierPath alloc] init];
|
||||
CGFloat lineWidth = 0.0859375 * theMaxSize;
|
||||
CGFloat lineStart = 0.234375 * theMaxSize;
|
||||
CGFloat lineEnd = 0.421875 * theMaxSize;
|
||||
[path setLineWidth:lineWidth];
|
||||
[path setLineCapStyle:NSRoundLineCapStyle];
|
||||
[path moveToPoint:NSMakePoint(0,lineStart)];
|
||||
[path lineToPoint:NSMakePoint(0,lineEnd)];
|
||||
|
||||
for (int i=0; i<finColors.count; i++) {
|
||||
if(_isAnimating) {
|
||||
[(NSColor*)finColors[i] set];
|
||||
}
|
||||
else {
|
||||
[[foreColor colorWithAlphaComponent:kAlphaWhenStopped] set];
|
||||
}
|
||||
|
||||
[path stroke];
|
||||
|
||||
CGContextRotateCTM(currentContext, 6.282185/finColors.count);
|
||||
}
|
||||
path = nil;
|
||||
|
||||
[NSGraphicsContext restoreGraphicsState];
|
||||
}
|
||||
|
||||
- (void)startAnimation:(id)sender
|
||||
{
|
||||
if (_isAnimating && !isFadingOut) return;
|
||||
|
||||
[self actuallyStartAnimation];
|
||||
}
|
||||
|
||||
- (void)stopAnimation:(id)sender
|
||||
{
|
||||
isFadingOut = YES;
|
||||
}
|
||||
|
||||
- (void)setColor:(NSColor *)value
|
||||
{
|
||||
if (foreColor != value) {
|
||||
foreColor = nil;
|
||||
foreColor = value;
|
||||
|
||||
for (int i=0; i<finColors.count; i++) {
|
||||
CGFloat alpha = [finColors[i] alphaComponent];
|
||||
[finColors setObject:[foreColor colorWithAlphaComponent:alpha] atIndexedSubscript:i];
|
||||
}
|
||||
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setBackgroundColor:(NSColor *)value
|
||||
{
|
||||
if (backColor != value) {
|
||||
backColor = nil;
|
||||
backColor = value;
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateFrame:(NSTimer *)timer
|
||||
{
|
||||
if(position > 0) {
|
||||
position--;
|
||||
}
|
||||
else {
|
||||
position = (int)finColors.count - 1;
|
||||
}
|
||||
|
||||
CGFloat minAlpha = kAlphaWhenStopped;
|
||||
for (int i=0; i<finColors.count; i++) {
|
||||
CGFloat newAlpha = [finColors[i] alphaComponent] * kFadeMultiplier;
|
||||
if (newAlpha < minAlpha)
|
||||
newAlpha = minAlpha;
|
||||
|
||||
finColors[i] = [foreColor colorWithAlphaComponent:newAlpha];
|
||||
}
|
||||
|
||||
if (isFadingOut) {
|
||||
BOOL done = YES;
|
||||
for (int i=0; i<finColors.count; i++) {
|
||||
if (fabs([finColors[i] alphaComponent] - minAlpha) > 0.01) {
|
||||
done = NO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (done) {
|
||||
[self actuallyStopAnimation];
|
||||
}
|
||||
}
|
||||
else {
|
||||
finColors[position] = foreColor;
|
||||
}
|
||||
|
||||
[self setNeedsDisplay:YES];
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)actuallyStartAnimation
|
||||
{
|
||||
[self actuallyStopAnimation];
|
||||
|
||||
_isAnimating = YES;
|
||||
isFadingOut = NO;
|
||||
|
||||
position = 1;
|
||||
|
||||
animationTimer = [NSTimer timerWithTimeInterval:(NSTimeInterval)0.05
|
||||
target:self
|
||||
selector:@selector(updateFrame:)
|
||||
userInfo:nil
|
||||
repeats:YES];
|
||||
|
||||
[[NSRunLoop currentRunLoop] addTimer:animationTimer forMode:NSRunLoopCommonModes];
|
||||
[[NSRunLoop currentRunLoop] addTimer:animationTimer forMode:NSDefaultRunLoopMode];
|
||||
[[NSRunLoop currentRunLoop] addTimer:animationTimer forMode:NSEventTrackingRunLoopMode];
|
||||
}
|
||||
|
||||
- (void)actuallyStopAnimation
|
||||
{
|
||||
_isAnimating = NO;
|
||||
isFadingOut = NO;
|
||||
|
||||
if (animationTimer) {
|
||||
// we were using timer-based animation
|
||||
[animationTimer invalidate];
|
||||
animationTimer = nil;
|
||||
}
|
||||
//[self setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
//
|
||||
// CPBezierPath.h
|
||||
// Cloud Play OSX
|
||||
//
|
||||
// Created by Daniel Jackson on 5/11/14.
|
||||
// Copyright (c) 2014 Daniel Jackson. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface DJBezierPath : NSBezierPath
|
||||
|
||||
- (CGPathRef)quartzPath;
|
||||
|
||||
@end
|
||||
-66
@@ -1,66 +0,0 @@
|
||||
//
|
||||
// CPBezierPath.m
|
||||
// Cloud Play OSX
|
||||
//
|
||||
// Created by Daniel Jackson on 5/11/14.
|
||||
// Copyright (c) 2014 Daniel Jackson. All rights reserved.
|
||||
//
|
||||
|
||||
#import "DJBezierPath.h"
|
||||
|
||||
@implementation DJBezierPath
|
||||
|
||||
- (CGPathRef)quartzPath
|
||||
{
|
||||
int i, numElements;
|
||||
|
||||
// Need to begin a path here.
|
||||
CGPathRef immutablePath = NULL;
|
||||
|
||||
// Then draw the path elements.
|
||||
numElements = (int)[self elementCount];
|
||||
if (numElements > 0)
|
||||
{
|
||||
CGMutablePathRef path = CGPathCreateMutable();
|
||||
NSPoint points[3];
|
||||
BOOL didClosePath = YES;
|
||||
|
||||
for (i = 0; i < numElements; i++)
|
||||
{
|
||||
switch ([self elementAtIndex:i associatedPoints:points])
|
||||
{
|
||||
case NSMoveToBezierPathElement:
|
||||
CGPathMoveToPoint(path, NULL, points[0].x, points[0].y);
|
||||
break;
|
||||
|
||||
case NSLineToBezierPathElement:
|
||||
CGPathAddLineToPoint(path, NULL, points[0].x, points[0].y);
|
||||
didClosePath = NO;
|
||||
break;
|
||||
|
||||
case NSCurveToBezierPathElement:
|
||||
CGPathAddCurveToPoint(path, NULL, points[0].x, points[0].y,
|
||||
points[1].x, points[1].y,
|
||||
points[2].x, points[2].y);
|
||||
didClosePath = NO;
|
||||
break;
|
||||
|
||||
case NSClosePathBezierPathElement:
|
||||
CGPathCloseSubpath(path);
|
||||
didClosePath = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Be sure the path is closed or Quartz may not do valid hit detection.
|
||||
if (!didClosePath)
|
||||
CGPathCloseSubpath(path);
|
||||
|
||||
immutablePath = CGPathCreateCopy(path);
|
||||
CGPathRelease(path);
|
||||
}
|
||||
|
||||
return immutablePath;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,66 +0,0 @@
|
||||
//
|
||||
// CPProgressView.h
|
||||
// Cloud Play OSX
|
||||
//
|
||||
// Created by Daniel Jackson on 4/22/14.
|
||||
// Copyright (c) 2014 Daniel Jackson. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
/*#define popupWidth 120
|
||||
#define popupHeight 120
|
||||
|
||||
#define popupAlpha 0.9
|
||||
|
||||
#define xOffset 0
|
||||
#define yOffset 0
|
||||
|
||||
#define indicatorSize 40*/
|
||||
|
||||
@class DJProgressIndicator;
|
||||
@class DJActivityIndicator;
|
||||
|
||||
@interface DJProgressHUD : NSView
|
||||
|
||||
+ (void)setBackgroundAlpha:(CGFloat)bgAlph disableActions:(BOOL)disActions;
|
||||
|
||||
+ (void)showStatus:(NSString*)status FromView:(NSView*)view;
|
||||
+ (void)showProgress:(CGFloat)progress withStatus:(NSString*)status FromView:(NSView*)view;
|
||||
|
||||
+ (void)dismiss;
|
||||
|
||||
//+ (void)popActivity;
|
||||
@property (nonatomic) BOOL keepActivityCount;
|
||||
|
||||
@property (nonatomic, readonly) BOOL animatingDismiss;
|
||||
@property (nonatomic, readonly) BOOL animatingShow;
|
||||
@property (nonatomic, readonly) BOOL displaying;
|
||||
@property (nonatomic, readonly) NSUInteger activityCount;
|
||||
|
||||
/*
|
||||
-----Customization----
|
||||
|
||||
Make all changes to [CPProgressView instance]
|
||||
Prior to showing popup, call -(void)orientPopup
|
||||
*/
|
||||
|
||||
#define pMaxWidth1 250
|
||||
#define pMaxHeight1 200
|
||||
|
||||
|
||||
|
||||
//General Popup Values
|
||||
@property (nonatomic) CGVector pOffset;
|
||||
@property (nonatomic) CGFloat pAlpha;
|
||||
|
||||
//Padding
|
||||
@property (nonatomic) CGFloat pPadding;
|
||||
|
||||
@property (nonatomic) CGSize indicatorSize;
|
||||
@property (nonatomic) CGVector indicatorOffset;
|
||||
@property (nonatomic) CGSize labelSize;
|
||||
@property (nonatomic) CGVector labelOffset;
|
||||
|
||||
@end
|
||||
-425
@@ -1,425 +0,0 @@
|
||||
//
|
||||
// CPProgressView.m
|
||||
// Cloud Play OSX
|
||||
//
|
||||
// Created by Daniel Jackson on 4/22/14.
|
||||
// Copyright (c) 2014 Daniel Jackson. All rights reserved.
|
||||
//
|
||||
|
||||
#import "DJProgressHUD.h"
|
||||
#import "DJActivityIndicator.h"
|
||||
#import "DJProgressIndicator.h"
|
||||
|
||||
#define DEBUG_LOGS 1
|
||||
|
||||
typedef void (^CompletionHander)(void);
|
||||
|
||||
@interface DJProgressHUD ()
|
||||
{
|
||||
NSView* parentView;
|
||||
|
||||
CGSize pSize; //This is set automatically based on the content
|
||||
DJActivityIndicator* activityIndicator;
|
||||
DJProgressIndicator* progressIndicator;
|
||||
NSTextField* label;
|
||||
|
||||
NSButton* backgroundMask;
|
||||
NSView* MainHUD;
|
||||
}
|
||||
|
||||
@property CGFloat backgroundAlpha;
|
||||
@property BOOL actionsEnabled;
|
||||
|
||||
@end
|
||||
|
||||
@implementation DJProgressHUD
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Class Methods
|
||||
|
||||
+ (void)showStatus:(NSString*)status FromView:(NSView*)view
|
||||
{
|
||||
[[self instance] showStatus:status FromView:view];
|
||||
}
|
||||
|
||||
+ (void)setBackgroundAlpha:(CGFloat)bgAlph disableActions:(BOOL)disActions
|
||||
{
|
||||
DJProgressHUD* theHUD = [self instance];
|
||||
theHUD.backgroundAlpha = bgAlph;
|
||||
|
||||
[theHUD setBackground];
|
||||
|
||||
}
|
||||
|
||||
+ (void)showProgress:(CGFloat)progress withStatus:(NSString*)status FromView:(NSView*)view
|
||||
{
|
||||
[[self instance] showProgress:progress withStatus:status FromView:view];
|
||||
}
|
||||
|
||||
+ (void)dismiss
|
||||
{
|
||||
if([[self instance] keepActivityCount]) {
|
||||
[[self instance] popActivity];
|
||||
}
|
||||
else {
|
||||
[[self instance] hideViewAnimated];
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)popActivity
|
||||
{
|
||||
[[self instance] popActivity];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Master Methods
|
||||
|
||||
- (void)showStatus:(NSString*)status FromView:(NSView*)view
|
||||
{
|
||||
parentView = view;
|
||||
|
||||
label.stringValue = status;
|
||||
|
||||
[activityIndicator setHidden:FALSE];
|
||||
[progressIndicator setHidden:TRUE];
|
||||
[activityIndicator startAnimation:nil];
|
||||
|
||||
if(![self displaying])
|
||||
[self showViewAnimated];
|
||||
else
|
||||
[self replaceViewQuick];
|
||||
}
|
||||
|
||||
- (void)addMask {
|
||||
|
||||
[backgroundMask removeFromSuperview];
|
||||
[backgroundMask setFrame:parentView.frame];
|
||||
[backgroundMask setEnabled:!_actionsEnabled];
|
||||
if(!backgroundMask.wantsLayer) {
|
||||
CALayer* layer = [CALayer layer];
|
||||
[backgroundMask setLayer:layer];
|
||||
}
|
||||
[backgroundMask.layer setOpacity:0.0];
|
||||
[parentView addSubview:backgroundMask positioned:NSWindowAbove relativeTo:self];
|
||||
}
|
||||
|
||||
- (void)removeMask {
|
||||
|
||||
[backgroundMask removeFromSuperview];
|
||||
// [backgroundMask.animator.layer setOpacity:0.0];
|
||||
}
|
||||
|
||||
- (void)showProgress:(CGFloat)progress withStatus:(NSString*)status FromView:(NSView*)view
|
||||
{
|
||||
parentView = view;
|
||||
|
||||
label.stringValue = status;
|
||||
|
||||
[activityIndicator setHidden:TRUE];
|
||||
[progressIndicator setHidden:FALSE];
|
||||
[activityIndicator stopAnimation:nil];
|
||||
[progressIndicator showProgress:progress];
|
||||
|
||||
if(![self displaying])
|
||||
[self showViewAnimated];
|
||||
else
|
||||
[self replaceViewQuick];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Instance Methods
|
||||
|
||||
-(void)replaceViewQuick
|
||||
{
|
||||
[self beginShowView];
|
||||
[MainHUD.layer setOpacity:_pAlpha];
|
||||
}
|
||||
|
||||
- (void)beginShowView
|
||||
{
|
||||
[self updateLayout];
|
||||
|
||||
if(!self.superview) [parentView addSubview:self];
|
||||
[self.layer setFrame:parentView.frame];
|
||||
[self addSubview:MainHUD];
|
||||
NSRect size = [self getCenterWithinRect:parentView.frame scale:1.0];
|
||||
[MainHUD.layer setFrame:size];
|
||||
|
||||
_displaying = true;
|
||||
_activityCount++;
|
||||
|
||||
[self addMask];
|
||||
|
||||
[activityIndicator.layer setOpacity:1.0];
|
||||
[progressIndicator.layer setOpacity:1.0];
|
||||
[label.layer setOpacity:1.0];
|
||||
}
|
||||
|
||||
-(void)finishHideView
|
||||
{
|
||||
[MainHUD removeFromSuperview];
|
||||
[self removeFromSuperview];
|
||||
parentView = nil;
|
||||
_displaying = false;
|
||||
|
||||
[self removeMask];
|
||||
|
||||
[activityIndicator stopAnimation:nil];
|
||||
}
|
||||
|
||||
- (void)showViewAnimated
|
||||
{
|
||||
if(![parentView wantsLayer])
|
||||
{
|
||||
[parentView setWantsLayer:TRUE];
|
||||
[parentView setLayer:[CALayer layer]];
|
||||
}
|
||||
if(![MainHUD wantsLayer])
|
||||
{
|
||||
[MainHUD setWantsLayer:TRUE];
|
||||
[MainHUD setLayer:[CALayer layer]];
|
||||
}
|
||||
|
||||
[self beginShowView];
|
||||
MainHUD.layer.opacity = 0.0;
|
||||
|
||||
NSRect sizeBefore = [self getCenterWithinRect:parentView.frame scale:0.75];
|
||||
[MainHUD.layer setFrame:sizeBefore];
|
||||
|
||||
_animatingShow = true;
|
||||
|
||||
[CATransaction flush];
|
||||
[CATransaction begin];
|
||||
[CATransaction setValue:[NSNumber numberWithFloat:0.15f]
|
||||
forKey:kCATransactionAnimationDuration];
|
||||
[CATransaction setCompletionBlock:^{
|
||||
_animatingShow = false;
|
||||
}];
|
||||
|
||||
[MainHUD.layer setFrame:[self getCenterWithinRect:parentView.frame scale:1.0]];
|
||||
[MainHUD.layer setOpacity:_pAlpha];
|
||||
[CATransaction commit];
|
||||
|
||||
[self setNeedsDisplay:TRUE];
|
||||
}
|
||||
|
||||
- (void)hideViewAnimated
|
||||
{
|
||||
if(![parentView wantsLayer])
|
||||
{
|
||||
[parentView setWantsLayer:TRUE];
|
||||
[parentView setLayer:[CALayer layer]];
|
||||
}
|
||||
if(![MainHUD wantsLayer])
|
||||
{
|
||||
[MainHUD setWantsLayer:TRUE];
|
||||
[MainHUD setLayer:[CALayer layer]];
|
||||
}
|
||||
|
||||
NSRect newSize = [self getCenterWithinRect:parentView.frame scale:0.75];
|
||||
|
||||
//The ring doesnt resize easily. Clear it.
|
||||
[progressIndicator clear];
|
||||
|
||||
_animatingDismiss = true;
|
||||
_animatingShow = true;
|
||||
|
||||
[CATransaction flush];
|
||||
[CATransaction begin];
|
||||
[CATransaction setValue:[NSNumber numberWithFloat:0.15f] forKey:kCATransactionAnimationDuration];
|
||||
[CATransaction setCompletionBlock:^{
|
||||
_animatingShow = false;
|
||||
if(MainHUD.layer.opacity == 0.0)
|
||||
{
|
||||
[self finishHideView];
|
||||
//[self updateLayout];
|
||||
[MainHUD addSubview:progressIndicator];
|
||||
}
|
||||
}];
|
||||
[activityIndicator.layer setOpacity:0.0];
|
||||
[label.layer setOpacity:0.0];
|
||||
[MainHUD.layer setFrame:newSize];
|
||||
[MainHUD.layer setOpacity:0.0];
|
||||
[CATransaction commit];
|
||||
|
||||
[self setNeedsDisplay:TRUE];
|
||||
}
|
||||
|
||||
- (void)popActivity
|
||||
{
|
||||
_activityCount--;
|
||||
if(_activityCount == 0)
|
||||
[self hideViewAnimated];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Laying It Out
|
||||
|
||||
- (void)updateLayout
|
||||
{
|
||||
[self setBackground];
|
||||
|
||||
CGSize maxContentSize = CGSizeMake(pMaxWidth1-(_pPadding*2), pMaxHeight1-(_pPadding*2));
|
||||
CGSize minContentSize = CGSizeMake(_indicatorSize.width, _indicatorSize.height);
|
||||
|
||||
CGFloat stringWidth = [label.stringValue sizeWithAttributes:@{ NSFontAttributeName : label.font }].width + 5;
|
||||
float stringHeight = [self heightForString:label.stringValue font:label.font width:maxContentSize.width] + 8;
|
||||
|
||||
if(label.stringValue == nil || label.stringValue.length == 0)
|
||||
stringHeight = 0;
|
||||
|
||||
stringWidth = (stringWidth > minContentSize.width) ? stringWidth : minContentSize.width;
|
||||
if(stringWidth > maxContentSize.width)
|
||||
stringWidth = maxContentSize.width;
|
||||
|
||||
CGFloat maxStringHeight = maxContentSize.height-_indicatorSize.height-(_pPadding+(_pPadding/2));
|
||||
stringHeight = (stringHeight > maxStringHeight) ? maxStringHeight : stringHeight;
|
||||
|
||||
CGFloat popupWidth = stringWidth+(_pPadding*2);
|
||||
|
||||
CGFloat lW = stringWidth;
|
||||
CGFloat lH = stringHeight;
|
||||
CGFloat lX = _pPadding;
|
||||
CGFloat lY = (stringHeight == 0) ? 0 : _pPadding;
|
||||
[label setFrame:NSMakeRect(lX, lY, lW, lH)];
|
||||
|
||||
CGFloat spaceBetween = (stringHeight != 0) ? _pPadding/3 : _pPadding;
|
||||
|
||||
CGFloat iW = _indicatorSize.width;
|
||||
CGFloat iH = _indicatorSize.height;
|
||||
CGFloat iX = ((lW+(_pPadding*2))/2)-(iW/2); //center it
|
||||
CGFloat iY = lY+lH+(spaceBetween);
|
||||
NSRect indicatorRect = NSMakeRect(iX, iY, iW, iH);
|
||||
activityIndicator.frame = progressIndicator.frame = indicatorRect;
|
||||
|
||||
CGFloat spaceOnTop = (stringHeight != 0) ? _pPadding/3 : 0;
|
||||
|
||||
[progressIndicator setRingThickness:6];
|
||||
[progressIndicator sizeToFit];
|
||||
[activityIndicator setColor:[NSColor whiteColor]];
|
||||
|
||||
pSize.width = popupWidth;
|
||||
pSize.height = iY+iH+_pPadding+spaceOnTop;//+(_pPadding/2);
|
||||
|
||||
[self setAutoresizesSubviews:YES];
|
||||
[MainHUD setAutoresizesSubviews:YES];
|
||||
|
||||
[self setNeedsDisplay:TRUE];
|
||||
[MainHUD setNeedsDisplay:TRUE];
|
||||
}
|
||||
|
||||
- (void)setBackground
|
||||
{
|
||||
CGColorRef bgcolor = CGColorCreateGenericRGB(0.05, 0.05, 0.05, _pAlpha);
|
||||
if(![MainHUD wantsLayer])
|
||||
{
|
||||
CALayer* bgLayer = [CALayer layer];
|
||||
[bgLayer setBackgroundColor:bgcolor];
|
||||
[bgLayer setCornerRadius:15.0];
|
||||
[MainHUD setWantsLayer:TRUE];
|
||||
[MainHUD setLayer:bgLayer];
|
||||
}
|
||||
else {
|
||||
[MainHUD.layer setBackgroundColor:bgcolor];
|
||||
[MainHUD.layer setCornerRadius:15.0];
|
||||
}
|
||||
|
||||
if(![self layer]) {
|
||||
CALayer* bgLayer = [CALayer layer];
|
||||
[self setLayer:bgLayer];
|
||||
[self setWantsLayer:TRUE];
|
||||
}
|
||||
|
||||
[self.layer setBackgroundColor:CGColorCreateGenericRGB(0, 0, 0, _backgroundAlpha)];
|
||||
|
||||
[self setNeedsDisplay:TRUE];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Other
|
||||
|
||||
-(CGFloat) heightForString:(NSString *)myString font:(NSFont*) myFont width:(CGFloat)myWidth
|
||||
{
|
||||
NSTextStorage *textStorage = [[NSTextStorage alloc] initWithString:myString];
|
||||
NSTextContainer *textContainer = [[NSTextContainer alloc] initWithContainerSize:NSMakeSize(myWidth, FLT_MAX)];
|
||||
;
|
||||
NSLayoutManager *layoutManager = [[NSLayoutManager alloc] init];
|
||||
[layoutManager addTextContainer:textContainer];
|
||||
[textStorage addLayoutManager:layoutManager];
|
||||
[textStorage addAttribute:NSFontAttributeName value:myFont
|
||||
range:NSMakeRange(0, [textStorage length])];
|
||||
[textContainer setLineFragmentPadding:0.0];
|
||||
|
||||
(void) [layoutManager glyphRangeForTextContainer:textContainer];
|
||||
return [layoutManager
|
||||
usedRectForTextContainer:textContainer].size.height;
|
||||
}
|
||||
|
||||
- (NSRect)getCenterWithinRect:(NSRect)parentFrame scale:(CGFloat)scale
|
||||
{
|
||||
NSRect result;
|
||||
CGFloat newWidth = pSize.width*scale;
|
||||
CGFloat newHeight = pSize.height*scale;
|
||||
result.origin.x = parentFrame.size.width/2 - newWidth/2 + _pOffset.dx;
|
||||
result.origin.y = parentFrame.size.height/2 - newHeight/2 + _pOffset.dy;
|
||||
result.size.width = newWidth;
|
||||
result.size.height = newHeight;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)initializePopup
|
||||
{
|
||||
self.autoresizingMask = NSViewMaxXMargin | NSViewMaxYMargin | NSViewMinXMargin | NSViewMinYMargin;
|
||||
MainHUD.autoresizingMask = NSViewMaxXMargin | NSViewMaxYMargin | NSViewMinXMargin | NSViewMinYMargin;
|
||||
|
||||
MainHUD = [[NSView alloc] init];
|
||||
activityIndicator = [[DJActivityIndicator alloc] init];
|
||||
progressIndicator = [[DJProgressIndicator alloc] init];
|
||||
backgroundMask = [[NSButton alloc] init];
|
||||
label = [[NSTextField alloc] init];
|
||||
|
||||
[self addSubview:MainHUD];
|
||||
[MainHUD addSubview:label];
|
||||
[MainHUD addSubview:activityIndicator];
|
||||
[MainHUD addSubview:progressIndicator];
|
||||
|
||||
//----DEFAULT VALUES----
|
||||
|
||||
_backgroundAlpha = 0.4;
|
||||
_actionsEnabled = FALSE;
|
||||
|
||||
_pOffset = CGVectorMake(0, 0);
|
||||
_pAlpha = 0.9;
|
||||
_pPadding = 10;
|
||||
|
||||
_indicatorSize = CGSizeMake(40, 40);
|
||||
_indicatorOffset = CGVectorMake(0, 0);
|
||||
|
||||
_indicatorSize = CGSizeMake(40, 40);
|
||||
_indicatorOffset = CGVectorMake(0, 0);
|
||||
|
||||
[label setBezeled:NO];
|
||||
[label setDrawsBackground:NO];
|
||||
[label setEditable:NO];
|
||||
[label setSelectable:NO];
|
||||
|
||||
label.font = [NSFont boldSystemFontOfSize:12.0];
|
||||
[label setTextColor:[NSColor colorWithCalibratedWhite:1.0 alpha:0.85]];
|
||||
}
|
||||
|
||||
+ (DJProgressHUD *) instance
|
||||
{
|
||||
static dispatch_once_t once;
|
||||
static DJProgressHUD *sharedView;
|
||||
dispatch_once(&once, ^ {
|
||||
sharedView = [[self alloc] init];
|
||||
[sharedView initializePopup];
|
||||
});
|
||||
|
||||
return sharedView;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,30 +0,0 @@
|
||||
//
|
||||
// DJProgressIndicator.h
|
||||
// Playground
|
||||
//
|
||||
// Created by Daniel Jackson on 5/11/14.
|
||||
// Copyright (c) 2014 Daniel Jackson. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
@interface DJProgressIndicator : NSView
|
||||
|
||||
@property (nonatomic,readonly) CGFloat currentProgress;
|
||||
|
||||
- (void)setBackgroundColor:(NSColor *)value;
|
||||
- (void)setRingColor:(NSColor *)value backgroundRingColor:(NSColor*)value2;
|
||||
- (void)setRingThickness:(CGFloat)thick;
|
||||
- (void)setRingRadius:(CGFloat)radius;
|
||||
|
||||
- (void)showProgress:(float)progress;
|
||||
|
||||
-(void)sizeToFit;
|
||||
|
||||
-(void)clear;
|
||||
|
||||
@property (nonatomic, readonly) CGFloat ringRadius;
|
||||
@property (nonatomic, readonly) CGFloat ringThickness;
|
||||
|
||||
@end
|
||||
@@ -1,249 +0,0 @@
|
||||
//
|
||||
// DJProgressIndicator.m
|
||||
// Playground
|
||||
//
|
||||
// Created by Daniel Jackson on 5/11/14.
|
||||
// Copyright (c) 2014 Daniel Jackson. All rights reserved.
|
||||
//
|
||||
|
||||
#import "DJProgressIndicator.h"
|
||||
#import "DJBezierPath.h"
|
||||
|
||||
@interface DJProgressIndicator ()
|
||||
{
|
||||
NSColor* backRingColor;
|
||||
NSColor* ringColor;
|
||||
NSColor* backColor;
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) CAShapeLayer *backgroundRingLayer;
|
||||
@property (nonatomic, strong) CAShapeLayer *ringLayer;
|
||||
|
||||
@end
|
||||
|
||||
@implementation DJProgressIndicator
|
||||
|
||||
- (id)initWithFrame:(NSRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
_currentProgress = 0;
|
||||
|
||||
_ringThickness = 6;
|
||||
_ringRadius = self.frame.size.width/2 - (_ringThickness);
|
||||
|
||||
backRingColor = [NSColor darkGrayColor];
|
||||
ringColor = [NSColor whiteColor];
|
||||
backColor = [NSColor clearColor];
|
||||
|
||||
[self setAutoresizesSubviews:YES];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)drawRect:(NSRect)dirtyRect
|
||||
{
|
||||
[super drawRect:dirtyRect];
|
||||
|
||||
//NSLog(@"Drawing");
|
||||
|
||||
[self setBackground];
|
||||
|
||||
[self resetRings];
|
||||
}
|
||||
|
||||
- (void)setBackground
|
||||
{
|
||||
if(![self wantsLayer])
|
||||
{
|
||||
CALayer* bgLayer = [CALayer layer];
|
||||
[bgLayer setBackgroundColor:backColor.CGColor];
|
||||
[self setWantsLayer:TRUE];
|
||||
[self setLayer:bgLayer];
|
||||
}
|
||||
else {
|
||||
[self.layer setBackgroundColor:backColor.CGColor];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)resetRings
|
||||
{
|
||||
[_ringLayer removeFromSuperlayer];
|
||||
_ringLayer = nil;
|
||||
[_backgroundRingLayer removeFromSuperlayer];
|
||||
_backgroundRingLayer = nil;
|
||||
|
||||
[self updateLayout];
|
||||
self.ringLayer.strokeEnd = _currentProgress;
|
||||
}
|
||||
|
||||
-(void)updateLayout
|
||||
{
|
||||
self.backgroundRingLayer.position = self.ringLayer.position = CGPointMake((CGRectGetWidth(self.bounds)/2), CGRectGetHeight(self.bounds)/2);
|
||||
}
|
||||
|
||||
- (void)showProgress:(float)progress {
|
||||
|
||||
NSLog(@"-----%f",progress);
|
||||
|
||||
_currentProgress = progress;
|
||||
|
||||
[self updateLayout];
|
||||
|
||||
if(progress >= 0) {
|
||||
self.ringLayer.strokeEnd = progress;
|
||||
}
|
||||
else {
|
||||
[self cancelRingLayerAnimation];
|
||||
}
|
||||
|
||||
//[self setNeedsDisplay:TRUE];
|
||||
}
|
||||
|
||||
- (CAShapeLayer *)ringLayer {
|
||||
if(!_ringLayer) {
|
||||
CGPoint center = CGPointMake(CGRectGetWidth(self.frame)/2, CGRectGetHeight(self.frame)/2);
|
||||
_ringLayer = [self createRingLayerWithCenter:center radius:_ringRadius lineWidth:_ringThickness color:ringColor];
|
||||
[self.layer addSublayer:_ringLayer];
|
||||
}
|
||||
return _ringLayer;
|
||||
}
|
||||
|
||||
- (CAShapeLayer *)backgroundRingLayer {
|
||||
if(!_backgroundRingLayer) {
|
||||
CGPoint center = CGPointMake(CGRectGetWidth(self.frame)/2, CGRectGetHeight(self.frame)/2);
|
||||
_backgroundRingLayer = [self createRingLayerWithCenter:center radius:_ringRadius lineWidth:_ringThickness color:backRingColor];
|
||||
_backgroundRingLayer.strokeEnd = 1;
|
||||
[self.layer addSublayer:_backgroundRingLayer];
|
||||
}
|
||||
return _backgroundRingLayer;
|
||||
}
|
||||
|
||||
- (void)cancelRingLayerAnimation {
|
||||
[CATransaction begin];
|
||||
[CATransaction setDisableActions:YES];
|
||||
[self.layer removeAllAnimations];
|
||||
|
||||
_ringLayer.strokeEnd = 0.0f;
|
||||
if (_ringLayer.superlayer) {
|
||||
[_ringLayer removeFromSuperlayer];
|
||||
}
|
||||
_ringLayer = nil;
|
||||
|
||||
if (_backgroundRingLayer.superlayer) {
|
||||
[_backgroundRingLayer removeFromSuperlayer];
|
||||
}
|
||||
_backgroundRingLayer = nil;
|
||||
|
||||
[CATransaction commit];
|
||||
}
|
||||
|
||||
-(void)clear
|
||||
{
|
||||
[self cancelRingLayerAnimation];
|
||||
}
|
||||
|
||||
- (CGPoint)pointOnCircleWithCenter:(CGPoint)center radius:(double)radius angleInDegrees:(double)angleInDegrees {
|
||||
float x = (float)(radius * cos(angleInDegrees * M_PI / 180)) + radius;
|
||||
float y = (float)(radius * sin(angleInDegrees * M_PI / 180)) + radius;
|
||||
return CGPointMake(x, y);
|
||||
}
|
||||
|
||||
|
||||
- (DJBezierPath *)createCirclePathWithCenter:(CGPoint)center radius:(CGFloat)radius sampleCount:(NSInteger)sampleCount {
|
||||
|
||||
DJBezierPath *smoothedPath = [[DJBezierPath alloc] init];
|
||||
CGPoint startPoint = [self pointOnCircleWithCenter:center radius:radius angleInDegrees:90];
|
||||
|
||||
[smoothedPath moveToPoint:startPoint];
|
||||
|
||||
CGFloat delta = 360.0f/sampleCount;
|
||||
CGFloat angleInDegrees = 90;
|
||||
for (NSInteger i=1; i<sampleCount; i++) {
|
||||
angleInDegrees -= delta;
|
||||
CGPoint point = [self pointOnCircleWithCenter:center radius:radius angleInDegrees:angleInDegrees];
|
||||
[smoothedPath lineToPoint:point];
|
||||
}
|
||||
|
||||
[smoothedPath lineToPoint:startPoint];
|
||||
|
||||
return smoothedPath;
|
||||
}
|
||||
|
||||
|
||||
- (CAShapeLayer *)createRingLayerWithCenter:(CGPoint)center radius:(CGFloat)radius lineWidth:(CGFloat)lineWidth color:(NSColor *)color {
|
||||
|
||||
DJBezierPath *smoothedPath = [self createCirclePathWithCenter:center radius:radius sampleCount:72];
|
||||
|
||||
CAShapeLayer *slice = [CAShapeLayer layer];
|
||||
slice.frame = CGRectMake(center.x-radius, center.y-radius, radius*2, radius*2);
|
||||
slice.fillColor = [NSColor clearColor].CGColor;
|
||||
slice.strokeColor = color.CGColor;
|
||||
slice.lineWidth = lineWidth;
|
||||
slice.lineCap = kCALineJoinBevel;
|
||||
slice.lineJoin = kCALineJoinBevel;
|
||||
|
||||
CGPathRef path = smoothedPath.quartzPath;
|
||||
slice.path = path;
|
||||
CGPathRelease(path);
|
||||
|
||||
|
||||
return slice;
|
||||
}
|
||||
|
||||
|
||||
- (void)setRingColor:(NSColor *)value backgroundRingColor:(NSColor*)value2
|
||||
{
|
||||
bool changed = false;
|
||||
|
||||
if (ringColor != value) {
|
||||
ringColor = nil;
|
||||
ringColor= value;
|
||||
changed = true;
|
||||
}
|
||||
if (backRingColor != value2) {
|
||||
backRingColor = nil;
|
||||
backRingColor = value2;
|
||||
changed = true;
|
||||
}
|
||||
if(changed) {
|
||||
[self resetRings];
|
||||
[self setNeedsDisplay:TRUE];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setBackgroundColor:(NSColor *)value
|
||||
{
|
||||
if (backColor != value) {
|
||||
//[backColor release];
|
||||
backColor = nil;
|
||||
backColor = value;
|
||||
[self setBackground];
|
||||
//[self setNeedsDisplay:TRUE];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setRingThickness:(CGFloat)thick
|
||||
{
|
||||
if(_ringThickness != thick) {
|
||||
_ringThickness = thick;
|
||||
[self resetRings];
|
||||
//[self setNeedsDisplay:TRUE];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setRingRadius:(CGFloat)radius
|
||||
{
|
||||
if(_ringRadius != radius) {
|
||||
_ringRadius = radius;
|
||||
[self resetRings];
|
||||
//[self setNeedsDisplay:TRUE];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)sizeToFit {
|
||||
_ringRadius = self.frame.size.width/2 - (_ringThickness);
|
||||
}
|
||||
|
||||
@end
|
||||
Generated
-338
@@ -1,338 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
DJProgressHUD_OSX
|
||||
Copyright (C) 2014 Daniel Jackson
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
{signature of Ty Coon}, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
Generated
-46
@@ -1,46 +0,0 @@
|
||||
DJProgressHUD
|
||||
=================
|
||||
|
||||
Progress and Activity HUD for OSX.
|
||||
|
||||
I am really excited to introduce this ProgressHUD for osx. When I started my first osx app, I noticed that there was not good alternative to SVProgressHUD for the mac. Because this is a such a great tool for displaying a process, I decided to write it for the mac.
|
||||
|
||||
Please let me know if you find this helpfull!
|
||||
|
||||

|
||||
|
||||
##Setup
|
||||
1. Add DJProgressHUD to your application directory
|
||||
2. Ensure ARC is enabled on the project
|
||||
3. Import the control you want to use
|
||||
4. Refer to the samples below for possible display options
|
||||
|
||||
##Whats included:
|
||||
- DJProgressHUD: A class to show a popup view to the user displaying the current progress or an activity indicator.
|
||||
- DJActivityIndicator: A customizable activity indicator. The mac's version, NSProgressIndicator, just doesn't cut it.
|
||||
- DJProgressIndicator: A customizable circular progress view. Change the thickness, radius, size and color. I couldnt find one for the mac. So again, I made one.
|
||||
|
||||
##Code Sample
|
||||
|
||||
Simple Progress - uses progress indicator
|
||||
|
||||
CGFloat currentProgress = 0.33;
|
||||
[DJProgressHUD showProgress:currentProgress withStatus:@"The Progress!" FromView:self.view];
|
||||
...
|
||||
[DJProgressHUD dismiss];
|
||||
|
||||
Simple Status - uses activity indicator
|
||||
|
||||
[DJProgressHUD showStatus:@"INDICATOR" FromView:self.view];
|
||||
...
|
||||
[DJProgressHUD dismiss];
|
||||
|
||||
Progress Indicator - Customizing
|
||||
|
||||
DJProgressIndicator* progress = [[DJProgressIndicator alloc] initWithFrame: ... ];
|
||||
[progress setRingThickness:8];
|
||||
[progress setRingRadius:15];
|
||||
[progress setBackgroundColor:[NSColor clearColor]];
|
||||
[progress setRingColor:[NSColor whiteColor] backgroundRingColor:[NSColor darkGrayColor]];
|
||||
[self.view addSubview:progress];
|
||||
[progress showProgress: 0.33 ];
|
||||
Generated
+16
-1
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// PFMoveApplication.h, version 1.22
|
||||
// PFMoveApplication.h, version 1.24
|
||||
// LetsMove
|
||||
//
|
||||
// Created by Andy Kim at Potion Factory LLC on 9/17/09
|
||||
@@ -9,9 +9,24 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
Moves the running application to ~/Applications or /Applications if the former does not exist.
|
||||
After the move, it relaunches app from the new location.
|
||||
DOES NOT work for sandboxed applications.
|
||||
|
||||
Call from \c NSApplication's delegate method \c -applicationWillFinishLaunching: method. */
|
||||
void PFMoveToApplicationsFolderIfNecessary(void);
|
||||
|
||||
/**
|
||||
Check whether an app move is currently in progress.
|
||||
Returns YES if LetsMove is currently in-progress trying to move the app to the Applications folder, or NO otherwise.
|
||||
This can be used to work around a crash with apps that terminate after last window is closed.
|
||||
See https://github.com/potionfactory/LetsMove/issues/64 for details. */
|
||||
BOOL PFMoveIsInProgress(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Generated
+40
-7
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// PFMoveApplication.m, version 1.22
|
||||
// PFMoveApplication.m, version 1.24
|
||||
// LetsMove
|
||||
//
|
||||
// Created by Andy Kim at Potion Factory LLC on 9/17/09
|
||||
@@ -9,15 +9,22 @@
|
||||
#import "PFMoveApplication.h"
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Security/Security.h>
|
||||
#import <dlfcn.h>
|
||||
#import <sys/param.h>
|
||||
#import <sys/mount.h>
|
||||
|
||||
@interface LetsMove : NSObject
|
||||
@end
|
||||
|
||||
@implementation LetsMove
|
||||
+ (NSBundle *)bundle {
|
||||
return [NSBundle bundleForClass:self];
|
||||
}
|
||||
@end
|
||||
|
||||
// Strings
|
||||
// These are macros to be able to use custom i18n tools
|
||||
#define _I10NS(nsstr) NSLocalizedStringFromTable(nsstr, @"MoveApplication", nil)
|
||||
#define _I10NS(nsstr) NSLocalizedStringFromTableInBundle(nsstr, @"MoveApplication", [LetsMove bundle], nil)
|
||||
#define kStrMoveApplicationCouldNotMove _I10NS(@"Could not move to Applications folder")
|
||||
#define kStrMoveApplicationQuestionTitle _I10NS(@"Move to Applications folder?")
|
||||
#define kStrMoveApplicationQuestionTitleHome _I10NS(@"Move to Applications folder in your Home folder?")
|
||||
@@ -39,7 +46,7 @@
|
||||
|
||||
|
||||
static NSString *AlertSuppressKey = @"moveToApplicationsFolderAlertSuppress";
|
||||
|
||||
static BOOL MoveInProgress = NO;
|
||||
|
||||
// Helper functions
|
||||
static NSString *PreferredInstallLocation(BOOL *isUserDirectory);
|
||||
@@ -57,6 +64,16 @@ static void Relaunch(NSString *destinationPath);
|
||||
|
||||
// Main worker function
|
||||
void PFMoveToApplicationsFolderIfNecessary(void) {
|
||||
|
||||
// Make sure to do our work on the main thread.
|
||||
// Apparently Electron apps need this for things to work properly.
|
||||
if (![NSThread isMainThread]) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
PFMoveToApplicationsFolderIfNecessary();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Skip if user suppressed the alert before
|
||||
if ([[NSUserDefaults standardUserDefaults] boolForKey:AlertSuppressKey]) return;
|
||||
|
||||
@@ -70,6 +87,9 @@ void PFMoveToApplicationsFolderIfNecessary(void) {
|
||||
// unless it's inside another app's bundle.
|
||||
if (IsInApplicationsFolder(bundlePath) && !isNestedApplication) return;
|
||||
|
||||
// OK, looks like we'll need to do a move - set the status variable appropriately
|
||||
MoveInProgress = YES;
|
||||
|
||||
// File Manager
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
|
||||
@@ -141,6 +161,7 @@ void PFMoveToApplicationsFolderIfNecessary(void) {
|
||||
if (!AuthorizedInstall(bundlePath, destinationPath, &authorizationCanceled)) {
|
||||
if (authorizationCanceled) {
|
||||
NSLog(@"INFO -- Not moving because user canceled authorization");
|
||||
MoveInProgress = NO;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
@@ -157,6 +178,7 @@ void PFMoveToApplicationsFolderIfNecessary(void) {
|
||||
// Give the running app focus and terminate myself
|
||||
NSLog(@"INFO -- Switching to an already running version");
|
||||
[[NSTask launchedTaskWithLaunchPath:@"/usr/bin/open" arguments:[NSArray arrayWithObject:destinationPath]] waitUntilExit];
|
||||
MoveInProgress = NO;
|
||||
exit(0);
|
||||
}
|
||||
else {
|
||||
@@ -189,6 +211,7 @@ void PFMoveToApplicationsFolderIfNecessary(void) {
|
||||
[NSTask launchedTaskWithLaunchPath:@"/bin/sh" arguments:[NSArray arrayWithObjects:@"-c", script, nil]];
|
||||
}
|
||||
|
||||
MoveInProgress = NO;
|
||||
exit(0);
|
||||
}
|
||||
// Save the alert suppress preference if checked
|
||||
@@ -196,6 +219,7 @@ void PFMoveToApplicationsFolderIfNecessary(void) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:AlertSuppressKey];
|
||||
}
|
||||
|
||||
MoveInProgress = NO;
|
||||
return;
|
||||
|
||||
fail:
|
||||
@@ -204,9 +228,14 @@ fail:
|
||||
alert = [[[NSAlert alloc] init] autorelease];
|
||||
[alert setMessageText:kStrMoveApplicationCouldNotMove];
|
||||
[alert runModal];
|
||||
MoveInProgress = NO;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL PFMoveIsInProgress() {
|
||||
return MoveInProgress;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Helper Functions
|
||||
|
||||
@@ -363,7 +392,11 @@ static BOOL Trash(NSString *path) {
|
||||
BOOL result = NO;
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8
|
||||
if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_8) {
|
||||
result = [[NSFileManager defaultManager] trashItemAtURL:[NSURL fileURLWithPath:path] resultingItemURL:NULL error:NULL];
|
||||
if (@available(macOS 10.8, *)) {
|
||||
result = [[NSFileManager defaultManager] trashItemAtURL:[NSURL fileURLWithPath:path] resultingItemURL:NULL error:NULL];
|
||||
} else {
|
||||
// Fallback on earlier versions
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11
|
||||
@@ -409,7 +442,7 @@ static BOOL DeleteOrTrash(NSString *path) {
|
||||
}
|
||||
else {
|
||||
// Don't log warning if on Sierra and running inside App Translocation path
|
||||
if (![path containsString:@"/AppTranslocation/"])
|
||||
if ([path rangeOfString:@"/AppTranslocation/"].location == NSNotFound)
|
||||
NSLog(@"WARNING -- Could not delete '%@': %@", path, [error localizedDescription]);
|
||||
|
||||
return Trash(path);
|
||||
|
||||
Generated
+13
-1
@@ -43,6 +43,16 @@ Public domain
|
||||
Version History
|
||||
---------------
|
||||
|
||||
* 1.24
|
||||
- Add PFMoveIsInProgress function
|
||||
- Update project for Xcode 9.1
|
||||
|
||||
* 1.23
|
||||
- Fix localization not being used when built as a framework
|
||||
- Fix backwards compatibility with OS X 10.9 and earlier being broken
|
||||
- Make usable for Electron based apps or other apps that do not have access to the main thread dispatch queue
|
||||
- Update Russian localization
|
||||
|
||||
* 1.22
|
||||
- Fix not deleting or trashing itself after copying to /Applications in macOS Sierra
|
||||
|
||||
@@ -166,12 +176,14 @@ Code Contributors:
|
||||
* Nick Moore
|
||||
* Nicholas Riley
|
||||
* Matt Prowse
|
||||
* Maxim Ananov
|
||||
* Charlie Stigler
|
||||
|
||||
|
||||
Translators:
|
||||
------------
|
||||
* Eita Hayashi (Japanese)
|
||||
* Gleb M. Borisov (Russian)
|
||||
* Gleb M. Borisov, Maxim Ananov (Russian)
|
||||
* Wouter Broekhof (Dutch)
|
||||
* Rasmus Andersson / Spotify (French and Spanish)
|
||||
* Markus Kirschner (German)
|
||||
|
||||
BIN
Binary file not shown.
Generated
+13
-7
@@ -1,18 +1,24 @@
|
||||
PODS:
|
||||
- DJProgressHUD_OSX (0.0.1)
|
||||
- ITSwitch (1.0)
|
||||
- LetsMove (1.22)
|
||||
- LetsMove (1.24)
|
||||
- STPrivilegedTask (1.0.1)
|
||||
|
||||
DEPENDENCIES:
|
||||
- DJProgressHUD_OSX
|
||||
- ITSwitch
|
||||
- LetsMove
|
||||
- STPrivilegedTask
|
||||
|
||||
SPEC REPOS:
|
||||
https://github.com/cocoapods/specs.git:
|
||||
- ITSwitch
|
||||
- LetsMove
|
||||
- STPrivilegedTask
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
DJProgressHUD_OSX: a8de6d2da8750dbf671fcddc649a44a9cd2807c4
|
||||
ITSwitch: 7ff745d6f2a6910e9194b23e4eab9a843258a478
|
||||
LetsMove: 407d4d14815e6dc1549b6a9fe8e4b0f6aed3e305
|
||||
LetsMove: fefe56bc7bc7fb7d37049e28a14f297961229fc5
|
||||
STPrivilegedTask: 103f97827454e786074640cf89d303be344498c7
|
||||
|
||||
PODFILE CHECKSUM: b1b05df537f199f1410c30e64c24cde88db79221
|
||||
PODFILE CHECKSUM: 4dca32d4d6791341e27820d98c0efe1419299b51
|
||||
|
||||
COCOAPODS: 1.2.0
|
||||
COCOAPODS: 1.7.0.rc.1
|
||||
|
||||
Generated
+754
-718
File diff suppressed because it is too large
Load Diff
-60
@@ -1,60 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0700"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForAnalyzing = "YES"
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = 'primary'
|
||||
BlueprintIdentifier = '429E750368B61ABCD8DFF8293D466E7D'
|
||||
BlueprintName = 'DJProgressHUD_OSX'
|
||||
ReferencedContainer = 'container:Pods.xcodeproj'
|
||||
BuildableName = 'DJProgressHUD_OSX.framework'>
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
buildConfiguration = "Debug"
|
||||
allowLocationSimulation = "YES">
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0700"
|
||||
LastUpgradeVersion = "1020"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -13,11 +13,11 @@
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = 'primary'
|
||||
BlueprintIdentifier = '1D1277B04944214E28E206D65F005710'
|
||||
BlueprintName = 'ITSwitch'
|
||||
ReferencedContainer = 'container:Pods.xcodeproj'
|
||||
BuildableName = 'ITSwitch.framework'>
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "9A32BAE58F8E5FFB7BE8A59E9B216786"
|
||||
BuildableName = "ITSwitch.framework"
|
||||
BlueprintName = "ITSwitch"
|
||||
ReferencedContainer = "container:Pods.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0700"
|
||||
LastUpgradeVersion = "1020"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -13,11 +13,11 @@
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = 'primary'
|
||||
BlueprintIdentifier = '92A4DE1508C6CA686DC4DDEB83341720'
|
||||
BlueprintName = 'LetsMove'
|
||||
ReferencedContainer = 'container:Pods.xcodeproj'
|
||||
BuildableName = 'LetsMove.framework'>
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F83960005EA88D0C24A1D277DD0E8667"
|
||||
BuildableName = "LetsMove.framework"
|
||||
BlueprintName = "LetsMove"
|
||||
ReferencedContainer = "container:Pods.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0700"
|
||||
LastUpgradeVersion = "1020"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -14,7 +14,7 @@
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "CD4182946621EBCCC3159A4373646698"
|
||||
BlueprintIdentifier = "6822A3C6F352B3FBBC37114BBA826EB3"
|
||||
BuildableName = "Pods_Get_It.framework"
|
||||
BlueprintName = "Pods-Get It"
|
||||
ReferencedContainer = "container:Pods.xcodeproj">
|
||||
@@ -45,7 +45,7 @@
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "CD4182946621EBCCC3159A4373646698"
|
||||
BlueprintIdentifier = "6822A3C6F352B3FBBC37114BBA826EB3"
|
||||
BuildableName = "Pods_Get_It.framework"
|
||||
BlueprintName = "Pods-Get It"
|
||||
ReferencedContainer = "container:Pods.xcodeproj">
|
||||
|
||||
+6
-27
@@ -4,11 +4,6 @@
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>DJProgressHUD_OSX.xcscheme</key>
|
||||
<dict>
|
||||
<key>isShown</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>ITSwitch.xcscheme</key>
|
||||
<dict>
|
||||
<key>isShown</key>
|
||||
@@ -24,29 +19,13 @@
|
||||
<key>isShown</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>STPrivilegedTask.xcscheme</key>
|
||||
<dict>
|
||||
<key>isShown</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
<dict>
|
||||
<key>1D1277B04944214E28E206D65F005710</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>429E750368B61ABCD8DFF8293D466E7D</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>92A4DE1508C6CA686DC4DDEB83341720</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>CD4182946621EBCCC3159A4373646698</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
Generated
+22
@@ -0,0 +1,22 @@
|
||||
# BSD License
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of Sveinbjorn Thordarson nor that of any other
|
||||
# contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
Generated
+58
@@ -0,0 +1,58 @@
|
||||
# STPrivilegedTask - Objective C class
|
||||
|
||||
An NSTask-like wrapper around AuthorizationExecuteWithPrivileges() in the Security API to run shell commands with root privileges in Mac OS X.
|
||||
|
||||
Example of usage:
|
||||
|
||||
```objective-c
|
||||
STPrivilegedTask *privilegedTask = [[STPrivilegedTask alloc] init];
|
||||
|
||||
[privilegedTask setLaunchPath:@"/usr/bin/touch"];
|
||||
NSArray *args = [NSArray arrayWithObject:@"/etc/my_test_file"];
|
||||
[privilegedTask setArguments:args];
|
||||
[privilegedTask setCurrentDirectoryPath:[[NSBundle mainBundle] resourcePath]];
|
||||
|
||||
//set it off
|
||||
OSStatus err = [privilegedTask launch];
|
||||
if (err != errAuthorizationSuccess) {
|
||||
if (err == errAuthorizationCanceled) {
|
||||
NSLog(@"User cancelled");
|
||||
} else {
|
||||
NSLog(@"Something went wrong");
|
||||
}
|
||||
}
|
||||
|
||||
// Read output file handle for data
|
||||
NSFileHandle *readHandle = [privilegedTask outputFileHandle];
|
||||
NSData *outputData = [readHandle readDataToEndOfFile];
|
||||
NSString *outputString = [[NSString alloc] initWithData:outputData encoding:NSUTF8StringEncoding];
|
||||
|
||||
```
|
||||
|
||||
# BSD License
|
||||
|
||||
```
|
||||
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of Sveinbjorn Thordarson nor that of any other
|
||||
# contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
```
|
||||
Generated
+81
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
#
|
||||
# STPrivilegedTask - NSTask-like wrapper around AuthorizationExecuteWithPrivileges
|
||||
# Copyright (C) 2009-2015 Sveinbjorn Thordarson <sveinbjornt@gmail.com>
|
||||
#
|
||||
# BSD License
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of Sveinbjorn Thordarson nor that of any other
|
||||
# contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <Carbon/Carbon.h>
|
||||
#import <Security/Authorization.h>
|
||||
#import <Security/AuthorizationTags.h>
|
||||
|
||||
#define STPrivilegedTaskDidTerminateNotification @"STPrivilegedTaskDidTerminateNotification"
|
||||
//#define TMP_STDERR_TEMPLATE @".authStderr.XXXXXX"
|
||||
|
||||
// Defines error value for when AuthorizationExecuteWithPrivilleges no longer
|
||||
// exists anyplace. Rather than defining a new enum, we just create a global
|
||||
// constant
|
||||
extern const OSStatus errAuthorizationFnNoLongerExists;
|
||||
|
||||
@interface STPrivilegedTask : NSObject
|
||||
{
|
||||
NSArray *arguments;
|
||||
NSString *cwd;
|
||||
NSString *launchPath;
|
||||
BOOL isRunning;
|
||||
pid_t pid;
|
||||
int terminationStatus;
|
||||
NSFileHandle *outputFileHandle;
|
||||
NSTimer *checkStatusTimer;
|
||||
}
|
||||
-(id)initWithLaunchPath:(NSString *)path;
|
||||
-(id)initWithLaunchPath:(NSString *)path arguments: (NSArray *)args;
|
||||
+(STPrivilegedTask *)launchedPrivilegedTaskWithLaunchPath:(NSString *)path;
|
||||
+(STPrivilegedTask *)launchedPrivilegedTaskWithLaunchPath:(NSString *)path arguments:(NSArray *)arguments;
|
||||
-(NSArray *)arguments;
|
||||
-(NSString *)currentDirectoryPath;
|
||||
-(BOOL)isRunning;
|
||||
-(int)launch;
|
||||
-(NSString *)launchPath;
|
||||
-(int)processIdentifier;
|
||||
-(void)setArguments:(NSArray *)arguments;
|
||||
-(void)setCurrentDirectoryPath:(NSString *)path;
|
||||
-(void)setLaunchPath:(NSString *)path;
|
||||
-(NSFileHandle *)outputFileHandle;
|
||||
-(void)terminate; // doesn't work
|
||||
-(int)terminationStatus;
|
||||
-(void)_checkTaskStatus;
|
||||
-(void)waitUntilExit;
|
||||
@end
|
||||
/*static OSStatus AuthorizationExecuteWithPrivilegesStdErrAndPid (
|
||||
AuthorizationRef authorization,
|
||||
const char *pathToTool,
|
||||
AuthorizationFlags options,
|
||||
char * const *arguments,
|
||||
FILE **communicationsPipe,
|
||||
FILE **errPipe,
|
||||
pid_t* processid
|
||||
);*/
|
||||
Generated
+461
@@ -0,0 +1,461 @@
|
||||
/*
|
||||
#
|
||||
# STPrivilegedTask - NSTask-like wrapper around AuthorizationExecuteWithPrivileges
|
||||
# Copyright (C) 2009-2015 Sveinbjorn Thordarson <sveinbjornt@gmail.com>
|
||||
#
|
||||
# BSD License
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of Sveinbjorn Thordarson nor that of any other
|
||||
# contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#import "STPrivilegedTask.h"
|
||||
#import <stdio.h>
|
||||
#import <unistd.h>
|
||||
#import <dlfcn.h>
|
||||
|
||||
/* New error code denoting that AuthorizationExecuteWithPrivileges no longer exists */
|
||||
OSStatus const errAuthorizationFnNoLongerExists = -70001;
|
||||
|
||||
@implementation STPrivilegedTask
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
launchPath = @"";
|
||||
cwd = [[NSString alloc] initWithString:[[NSFileManager defaultManager] currentDirectoryPath]];
|
||||
arguments = [[NSArray alloc] init];
|
||||
isRunning = NO;
|
||||
outputFileHandle = nil;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)dealloc
|
||||
{
|
||||
#if !__has_feature(objc_arc)
|
||||
[launchPath release];
|
||||
[arguments release];
|
||||
[cwd release];
|
||||
|
||||
if (outputFileHandle != nil) {
|
||||
[outputFileHandle release];
|
||||
}
|
||||
[super dealloc];
|
||||
#endif
|
||||
}
|
||||
|
||||
-(id)initWithLaunchPath:(NSString *)path arguments:(NSArray *)args
|
||||
{
|
||||
if ((self = [self initWithLaunchPath:path])) {
|
||||
[self setArguments:args];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(id)initWithLaunchPath:(NSString *)path
|
||||
{
|
||||
if ((self = [self init])) {
|
||||
[self setLaunchPath:path];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
+(STPrivilegedTask *)launchedPrivilegedTaskWithLaunchPath:(NSString *)path arguments:(NSArray *)args
|
||||
{
|
||||
STPrivilegedTask *task = [[STPrivilegedTask alloc] initWithLaunchPath:path arguments:args];
|
||||
#if !__has_feature(objc_arc)
|
||||
[task autorelease];
|
||||
#endif
|
||||
|
||||
[task launch];
|
||||
[task waitUntilExit];
|
||||
return task;
|
||||
}
|
||||
|
||||
+(STPrivilegedTask *)launchedPrivilegedTaskWithLaunchPath:(NSString *)path
|
||||
{
|
||||
STPrivilegedTask *task = [[STPrivilegedTask alloc] initWithLaunchPath:path];
|
||||
#if !__has_feature(objc_arc)
|
||||
[task autorelease];
|
||||
#endif
|
||||
[task launch];
|
||||
[task waitUntilExit];
|
||||
return task;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (NSArray *)arguments
|
||||
{
|
||||
return arguments;
|
||||
}
|
||||
|
||||
- (NSString *)currentDirectoryPath;
|
||||
{
|
||||
return cwd;
|
||||
}
|
||||
|
||||
- (BOOL)isRunning
|
||||
{
|
||||
return isRunning;
|
||||
}
|
||||
|
||||
- (NSString *)launchPath
|
||||
{
|
||||
return launchPath;
|
||||
}
|
||||
|
||||
- (int)processIdentifier
|
||||
{
|
||||
return pid;
|
||||
}
|
||||
|
||||
- (int)terminationStatus
|
||||
{
|
||||
return terminationStatus;
|
||||
}
|
||||
|
||||
- (NSFileHandle *)outputFileHandle;
|
||||
{
|
||||
return outputFileHandle;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
-(void)setArguments:(NSArray *)args
|
||||
{
|
||||
#if !__has_feature(objc_arc)
|
||||
[arguments release];
|
||||
[args retain];
|
||||
#endif
|
||||
arguments = args;
|
||||
}
|
||||
|
||||
-(void)setCurrentDirectoryPath:(NSString *)path
|
||||
{
|
||||
#if !__has_feature(objc_arc)
|
||||
[cwd release];
|
||||
[path retain];
|
||||
#endif
|
||||
cwd = path;
|
||||
}
|
||||
|
||||
-(void)setLaunchPath:(NSString *)path
|
||||
{
|
||||
#if !__has_feature(objc_arc)
|
||||
[launchPath release];
|
||||
[path retain];
|
||||
#endif
|
||||
launchPath = path;
|
||||
}
|
||||
|
||||
# pragma mark -
|
||||
|
||||
// return 0 for success
|
||||
-(int)launch
|
||||
{
|
||||
OSStatus err = noErr;
|
||||
const char *toolPath = [launchPath fileSystemRepresentation];
|
||||
|
||||
AuthorizationRef authorizationRef;
|
||||
AuthorizationItem myItems = {kAuthorizationRightExecute, strlen(toolPath), &toolPath, 0};
|
||||
AuthorizationRights myRights = {1, &myItems};
|
||||
AuthorizationFlags flags = kAuthorizationFlagDefaults | kAuthorizationFlagInteractionAllowed | kAuthorizationFlagPreAuthorize | kAuthorizationFlagExtendRights;
|
||||
|
||||
NSUInteger numberOfArguments = [arguments count];
|
||||
char *args[numberOfArguments + 1];
|
||||
FILE *outputFile;
|
||||
|
||||
// Create fn pointer to AuthorizationExecuteWithPrivileges in case it doesn't exist
|
||||
// in this version of MacOS
|
||||
static OSStatus (*_AuthExecuteWithPrivsFn)(
|
||||
AuthorizationRef authorization, const char *pathToTool, AuthorizationFlags options,
|
||||
char * const *arguments, FILE **communicationsPipe) = NULL;
|
||||
|
||||
// Check to see if we have the correct function in our loaded libraries
|
||||
if (!_AuthExecuteWithPrivsFn) {
|
||||
// On 10.7, AuthorizationExecuteWithPrivileges is deprecated. We want
|
||||
// to still use it since there's no good alternative (without requiring
|
||||
// code signing). We'll look up the function through dyld and fail if
|
||||
// it is no longer accessible. If Apple removes the function entirely
|
||||
// this will fail gracefully. If they keep the function and throw some
|
||||
// sort of exception, this won't fail gracefully, but that's a risk
|
||||
// we'll have to take for now.
|
||||
// Pattern by Andy Kim from Potion Factory LLC
|
||||
_AuthExecuteWithPrivsFn = dlsym(RTLD_DEFAULT, "AuthorizationExecuteWithPrivileges");
|
||||
if (!_AuthExecuteWithPrivsFn) {
|
||||
// This version of OS X has finally removed this function. Exit with an error.
|
||||
err = errAuthorizationFnNoLongerExists;
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
// Use Apple's Authentication Manager APIs to get an Authorization Reference
|
||||
// These Apple APIs are quite possibly the most horrible of the Mac OS X APIs
|
||||
|
||||
// create authorization reference
|
||||
err = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &authorizationRef);
|
||||
if (err != errAuthorizationSuccess) {
|
||||
return err;
|
||||
}
|
||||
|
||||
// pre-authorize the privileged operation
|
||||
err = AuthorizationCopyRights(authorizationRef, &myRights, kAuthorizationEmptyEnvironment, flags, NULL);
|
||||
if (err != errAuthorizationSuccess) {
|
||||
return err;
|
||||
}
|
||||
|
||||
// OK, at this point we have received authorization for the task.
|
||||
// Let's prepare to launch it
|
||||
|
||||
// first, construct an array of c strings from NSArray w. arguments
|
||||
for (int i = 0; i < numberOfArguments; i++) {
|
||||
NSString *argString = arguments[i];
|
||||
NSUInteger stringLength = [argString length];
|
||||
|
||||
args[i] = malloc((stringLength + 1) * sizeof(char));
|
||||
snprintf(args[i], stringLength + 1, "%s", [argString fileSystemRepresentation]);
|
||||
}
|
||||
args[numberOfArguments] = NULL;
|
||||
|
||||
// change to the current dir specified
|
||||
char *prevCwd = (char *)getcwd(nil, 0);
|
||||
chdir([cwd fileSystemRepresentation]);
|
||||
|
||||
//use Authorization Reference to execute script with privileges
|
||||
err = _AuthExecuteWithPrivsFn(authorizationRef, [launchPath fileSystemRepresentation], kAuthorizationFlagDefaults, args, &outputFile);
|
||||
|
||||
// OK, now we're done executing, let's change back to old dir
|
||||
chdir(prevCwd);
|
||||
|
||||
// free the malloc'd argument strings
|
||||
for (int i = 0; i < numberOfArguments; i++) {
|
||||
free(args[i]);
|
||||
}
|
||||
|
||||
// free the auth ref
|
||||
AuthorizationFree(authorizationRef, kAuthorizationFlagDefaults);
|
||||
|
||||
// we return err if execution failed
|
||||
if (err != errAuthorizationSuccess) {
|
||||
return err;
|
||||
} else {
|
||||
isRunning = YES;
|
||||
}
|
||||
|
||||
// get file handle for the command output
|
||||
outputFileHandle = [[NSFileHandle alloc] initWithFileDescriptor:fileno(outputFile) closeOnDealloc:YES];
|
||||
pid = fcntl(fileno(outputFile), F_GETOWN, 0);
|
||||
|
||||
// start monitoring task
|
||||
checkStatusTimer = [NSTimer scheduledTimerWithTimeInterval:0.10 target:self selector:@selector(_checkTaskStatus) userInfo:nil repeats:YES];
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
- (void)terminate
|
||||
{
|
||||
// This doesn't work without a PID, and we can't get one. Stupid Security API
|
||||
/* int ret = kill(pid, SIGKILL);
|
||||
|
||||
if (ret != 0)
|
||||
NSLog(@"Error %d", errno);*/
|
||||
}
|
||||
|
||||
// hang until task is done
|
||||
- (void)waitUntilExit
|
||||
{
|
||||
waitpid([self processIdentifier], &terminationStatus, 0);
|
||||
isRunning = NO;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
// check if privileged task is still running
|
||||
- (void)_checkTaskStatus
|
||||
{
|
||||
// see if task has terminated
|
||||
int mypid = waitpid([self processIdentifier], &terminationStatus, WNOHANG);
|
||||
if (mypid != 0) {
|
||||
isRunning = NO;
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:STPrivilegedTaskDidTerminateNotification object:self];
|
||||
[checkStatusTimer invalidate];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (NSString *)description
|
||||
{
|
||||
NSArray *args = [self arguments];
|
||||
NSString *cmd = [[self launchPath] copy];
|
||||
|
||||
for (int i = 0; i < [args count]; i++) {
|
||||
cmd = [cmd stringByAppendingFormat:@" %@", args[i]];
|
||||
}
|
||||
|
||||
return [[super description] stringByAppendingFormat:@" %@", cmd];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/*
|
||||
*
|
||||
* Add the Standard err Pipe and Pid support to AuthorizationExecuteWithPrivileges()
|
||||
* method
|
||||
*
|
||||
* @Author: Miklós Fazekas
|
||||
* Modified Aug 10 2010 by Sveinbjorn Thordarson
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*static OSStatus AuthorizationExecuteWithPrivilegesStdErrAndPid (
|
||||
AuthorizationRef authorization,
|
||||
const char *pathToTool,
|
||||
AuthorizationFlags options,
|
||||
char * const *arguments,
|
||||
FILE **communicationsPipe,
|
||||
FILE **errPipe,
|
||||
pid_t* processid
|
||||
)
|
||||
{
|
||||
// get the Apple-approved secure temp directory
|
||||
NSString *tempFileTemplate = [NSTemporaryDirectory() stringByAppendingPathComponent: TMP_STDERR_TEMPLATE];
|
||||
|
||||
// copy it into a C string
|
||||
const char *tempFileTemplateCString = [tempFileTemplate fileSystemRepresentation];
|
||||
char *stderrpath = (char *)malloc(strlen(tempFileTemplateCString) + 1);
|
||||
strcpy(stderrpath, tempFileTemplateCString);
|
||||
|
||||
printf("%s\n", stderrpath);
|
||||
|
||||
// this is the command, it echoes pid and directs stderr output to pipe before running the tool w. args
|
||||
const char *commandtemplate = "echo $$; \"$@\" 2>%s";
|
||||
|
||||
if (communicationsPipe == errPipe)
|
||||
commandtemplate = "echo $$; \"$@\" 2>1";
|
||||
else if (errPipe == 0)
|
||||
commandtemplate = "echo $$; \"$@\"";
|
||||
|
||||
char command[1024];
|
||||
char **args;
|
||||
OSStatus result;
|
||||
int argcount = 0;
|
||||
int i;
|
||||
int stderrfd = 0;
|
||||
FILE *commPipe = 0;
|
||||
|
||||
// First, create temporary file for stderr
|
||||
if (errPipe)
|
||||
{
|
||||
// create temp file
|
||||
stderrfd = mkstemp(stderrpath);
|
||||
|
||||
// close and remove it
|
||||
close(stderrfd);
|
||||
unlink(stderrpath);
|
||||
|
||||
// create a pipe on the path of the temp file
|
||||
if (mkfifo(stderrpath,S_IRWXU | S_IRWXG) != 0)
|
||||
{
|
||||
fprintf(stderr,"Error mkfifo:%d\n", errno);
|
||||
return errAuthorizationInternal;
|
||||
}
|
||||
|
||||
if (stderrfd < 0)
|
||||
return errAuthorizationInternal;
|
||||
}
|
||||
|
||||
// Create command to be executed
|
||||
for (argcount = 0; arguments[argcount] != 0; ++argcount) {}
|
||||
args = (char**)malloc (sizeof(char*)*(argcount + 5));
|
||||
args[0] = "-c";
|
||||
snprintf (command, sizeof (command), commandtemplate, stderrpath);
|
||||
args[1] = command;
|
||||
args[2] = "";
|
||||
args[3] = (char*)pathToTool;
|
||||
for (i = 0; i < argcount; ++i) {
|
||||
args[i+4] = arguments[i];
|
||||
}
|
||||
args[argcount+4] = 0;
|
||||
|
||||
// for debugging: log the executed command
|
||||
printf ("Exec:\n%s", "/bin/sh"); for (i = 0; args[i] != 0; ++i) { printf (" \"%s\"", args[i]); } printf ("\n");
|
||||
|
||||
// Execute command
|
||||
result = AuthorizationExecuteWithPrivileges(authorization, "/bin/sh", options, args, &commPipe );
|
||||
if (result != noErr)
|
||||
{
|
||||
unlink (stderrpath);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Read the first line of stdout => it's the pid
|
||||
{
|
||||
int stdoutfd = fileno (commPipe);
|
||||
char pidnum[1024];
|
||||
pid_t pid = 0;
|
||||
int i = 0;
|
||||
char ch = 0;
|
||||
|
||||
while ((read(stdoutfd, &ch, sizeof(ch)) == 1) && (ch != '\n') && (i < sizeof(pidnum)))
|
||||
{
|
||||
pidnum[i++] = ch;
|
||||
}
|
||||
pidnum[i] = 0;
|
||||
|
||||
if (ch != '\n')
|
||||
{
|
||||
// we shouldn't get there
|
||||
unlink (stderrpath);
|
||||
return errAuthorizationInternal;
|
||||
}
|
||||
sscanf(pidnum, "%d", &pid);
|
||||
if (processid)
|
||||
{
|
||||
*processid = pid;
|
||||
}
|
||||
NSLog(@"Have PID %d", pid);
|
||||
}
|
||||
|
||||
//
|
||||
if (errPipe) {
|
||||
stderrfd = open(stderrpath, O_RDONLY, 0);
|
||||
// *errPipe = fdopen(stderrfd, "r");
|
||||
//Now it's safe to unlink the stderr file, as the opened handle will be still valid
|
||||
unlink (stderrpath);
|
||||
} else {
|
||||
unlink(stderrpath);
|
||||
}
|
||||
|
||||
if (communicationsPipe)
|
||||
*communicationsPipe = commPipe;
|
||||
else
|
||||
fclose (commPipe);
|
||||
|
||||
NSLog(@"AuthExecNew function over");
|
||||
|
||||
return noErr;
|
||||
}*/
|
||||
@@ -1,5 +0,0 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
@interface PodsDummy_DJProgressHUD_OSX : NSObject
|
||||
@end
|
||||
@implementation PodsDummy_DJProgressHUD_OSX
|
||||
@end
|
||||
@@ -1,20 +0,0 @@
|
||||
#ifdef __OBJC__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#else
|
||||
#ifndef FOUNDATION_EXPORT
|
||||
#if defined(__cplusplus)
|
||||
#define FOUNDATION_EXPORT extern "C"
|
||||
#else
|
||||
#define FOUNDATION_EXPORT extern
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#import "DJActivityIndicator.h"
|
||||
#import "DJBezierPath.h"
|
||||
#import "DJProgressHUD.h"
|
||||
#import "DJProgressIndicator.h"
|
||||
|
||||
FOUNDATION_EXPORT double DJProgressHUD_OSXVersionNumber;
|
||||
FOUNDATION_EXPORT const unsigned char DJProgressHUD_OSXVersionString[];
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
framework module DJProgressHUD_OSX {
|
||||
umbrella header "DJProgressHUD_OSX-umbrella.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
CODE_SIGN_IDENTITY =
|
||||
CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/DJProgressHUD_OSX
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
|
||||
OTHER_LDFLAGS = -framework "QuartzCore"
|
||||
PODS_BUILD_DIR = $BUILD_DIR
|
||||
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_ROOT = ${SRCROOT}
|
||||
PODS_TARGET_SRCROOT = ${PODS_ROOT}/DJProgressHUD_OSX
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||
SKIP_INSTALL = YES
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.0.1</string>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
+4
-5
@@ -1,10 +1,9 @@
|
||||
CODE_SIGN_IDENTITY =
|
||||
CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/ITSwitch
|
||||
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/ITSwitch
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
|
||||
OTHER_LDFLAGS = -framework "QuartzCore"
|
||||
PODS_BUILD_DIR = $BUILD_DIR
|
||||
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
OTHER_LDFLAGS = $(inherited) -framework "QuartzCore"
|
||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_ROOT = ${SRCROOT}
|
||||
PODS_TARGET_SRCROOT = ${PODS_ROOT}/ITSwitch
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.22.0</string>
|
||||
<string>1.24.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.24.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
+3
-4
@@ -1,9 +1,8 @@
|
||||
CODE_SIGN_IDENTITY =
|
||||
CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/LetsMove
|
||||
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LetsMove
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
|
||||
PODS_BUILD_DIR = $BUILD_DIR
|
||||
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_ROOT = ${SRCROOT}
|
||||
PODS_TARGET_SRCROOT = ${PODS_ROOT}/LetsMove
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
+26
-342
@@ -1,348 +1,6 @@
|
||||
# Acknowledgements
|
||||
This application makes use of the following third party libraries:
|
||||
|
||||
## DJProgressHUD_OSX
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
DJProgressHUD_OSX
|
||||
Copyright (C) 2014 Daniel Jackson
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
{signature of Ty Coon}, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
|
||||
|
||||
## ITSwitch
|
||||
|
||||
Apache License
|
||||
@@ -548,4 +206,30 @@ Apache License
|
||||
limitations under the License.
|
||||
|
||||
|
||||
|
||||
## STPrivilegedTask
|
||||
|
||||
# BSD License
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of Sveinbjorn Thordarson nor that of any other
|
||||
# contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Generated by CocoaPods - https://cocoapods.org
|
||||
|
||||
+32
-348
@@ -12,354 +12,6 @@
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string> GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
DJProgressHUD_OSX
|
||||
Copyright (C) 2014 Daniel Jackson
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
{signature of Ty Coon}, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
</string>
|
||||
<key>License</key>
|
||||
<string>GNU</string>
|
||||
<key>Title</key>
|
||||
<string>DJProgressHUD_OSX</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>Apache License
|
||||
@@ -572,6 +224,38 @@ Public License instead of this License.
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string> # BSD License
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of Sveinbjorn Thordarson nor that of any other
|
||||
# contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</string>
|
||||
<key>License</key>
|
||||
<string>BSD</string>
|
||||
<key>Title</key>
|
||||
<string>STPrivilegedTask</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>Generated by CocoaPods - https://cocoapods.org</string>
|
||||
|
||||
+92
-20
@@ -1,11 +1,33 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
function on_error {
|
||||
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
|
||||
}
|
||||
trap 'on_error $LINENO' ERR
|
||||
|
||||
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
|
||||
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
|
||||
# frameworks to, so exit 0 (signalling the script phase was successful).
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
|
||||
COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
|
||||
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
|
||||
|
||||
# Used as a return value for each invocation of `strip_invalid_archs` function.
|
||||
STRIP_BINARY_RETVAL=0
|
||||
|
||||
# This protects against multiple targets copying the same framework dependency at the same time. The solution
|
||||
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
|
||||
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
|
||||
|
||||
# Copies and strips a vendored framework
|
||||
install_framework()
|
||||
{
|
||||
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
|
||||
@@ -19,19 +41,24 @@ install_framework()
|
||||
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
|
||||
if [ -L "${source}" ]; then
|
||||
echo "Symlinked..."
|
||||
source="$(readlink "${source}")"
|
||||
echo "Symlinked..."
|
||||
source="$(readlink "${source}")"
|
||||
fi
|
||||
|
||||
# use filter instead of exclude so missing patterns dont' throw errors
|
||||
echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
|
||||
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
|
||||
# Use filter instead of exclude so missing patterns don't throw errors.
|
||||
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
|
||||
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
|
||||
|
||||
local basename
|
||||
basename="$(basename -s .framework "$1")"
|
||||
binary="${destination}/${basename}.framework/${basename}"
|
||||
|
||||
if ! [ -r "$binary" ]; then
|
||||
binary="${destination}/${basename}"
|
||||
elif [ -L "${binary}" ]; then
|
||||
echo "Destination binary is symlinked..."
|
||||
dirname="$(dirname "${binary}")"
|
||||
binary="${dirname}/$(readlink "${binary}")"
|
||||
fi
|
||||
|
||||
# Strip invalid architectures so "fat" simulator / device frameworks work on device
|
||||
@@ -45,7 +72,7 @@ install_framework()
|
||||
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
|
||||
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
|
||||
local swift_runtime_libs
|
||||
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
|
||||
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u)
|
||||
for lib in $swift_runtime_libs; do
|
||||
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
|
||||
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
|
||||
@@ -54,12 +81,48 @@ install_framework()
|
||||
fi
|
||||
}
|
||||
|
||||
# Copies and strips a vendored dSYM
|
||||
install_dsym() {
|
||||
local source="$1"
|
||||
if [ -r "$source" ]; then
|
||||
# Copy the dSYM into a the targets temp dir.
|
||||
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
|
||||
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
|
||||
|
||||
local basename
|
||||
basename="$(basename -s .framework.dSYM "$source")"
|
||||
binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
|
||||
|
||||
# Strip invalid architectures so "fat" simulator / device frameworks work on device
|
||||
if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
|
||||
strip_invalid_archs "$binary"
|
||||
fi
|
||||
|
||||
if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
|
||||
# Move the stripped file into its final destination.
|
||||
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
|
||||
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
|
||||
else
|
||||
# The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
|
||||
touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Copies the bcsymbolmap files of a vendored framework
|
||||
install_bcsymbolmap() {
|
||||
local bcsymbolmap_path="$1"
|
||||
local destination="${BUILT_PRODUCTS_DIR}"
|
||||
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}""
|
||||
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"
|
||||
}
|
||||
|
||||
# Signs a framework with the provided identity
|
||||
code_sign_if_enabled() {
|
||||
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
|
||||
# Use the current code_sign_identitiy
|
||||
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
|
||||
# Use the current code_sign_identity
|
||||
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
|
||||
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
|
||||
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
|
||||
|
||||
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
|
||||
code_sign_cmd="$code_sign_cmd &"
|
||||
@@ -72,31 +135,40 @@ code_sign_if_enabled() {
|
||||
# Strip invalid architectures
|
||||
strip_invalid_archs() {
|
||||
binary="$1"
|
||||
# Get architectures for current file
|
||||
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
|
||||
# Get architectures for current target binary
|
||||
binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
|
||||
# Intersect them with the architectures we are building for
|
||||
intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
|
||||
# If there are no archs supported by this binary then warn the user
|
||||
if [[ -z "$intersected_archs" ]]; then
|
||||
echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
|
||||
STRIP_BINARY_RETVAL=0
|
||||
return
|
||||
fi
|
||||
stripped=""
|
||||
for arch in $archs; do
|
||||
if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
|
||||
for arch in $binary_archs; do
|
||||
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
|
||||
# Strip non-valid architectures in-place
|
||||
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
|
||||
lipo -remove "$arch" -output "$binary" "$binary"
|
||||
stripped="$stripped $arch"
|
||||
fi
|
||||
done
|
||||
if [[ "$stripped" ]]; then
|
||||
echo "Stripped $binary of architectures:$stripped"
|
||||
fi
|
||||
STRIP_BINARY_RETVAL=1
|
||||
}
|
||||
|
||||
|
||||
if [[ "$CONFIGURATION" == "Debug" ]]; then
|
||||
install_framework "$BUILT_PRODUCTS_DIR/DJProgressHUD_OSX/DJProgressHUD_OSX.framework"
|
||||
install_framework "$BUILT_PRODUCTS_DIR/ITSwitch/ITSwitch.framework"
|
||||
install_framework "$BUILT_PRODUCTS_DIR/LetsMove/LetsMove.framework"
|
||||
install_framework "${BUILT_PRODUCTS_DIR}/ITSwitch/ITSwitch.framework"
|
||||
install_framework "${BUILT_PRODUCTS_DIR}/LetsMove/LetsMove.framework"
|
||||
install_framework "${BUILT_PRODUCTS_DIR}/STPrivilegedTask/STPrivilegedTask.framework"
|
||||
fi
|
||||
if [[ "$CONFIGURATION" == "Release" ]]; then
|
||||
install_framework "$BUILT_PRODUCTS_DIR/DJProgressHUD_OSX/DJProgressHUD_OSX.framework"
|
||||
install_framework "$BUILT_PRODUCTS_DIR/ITSwitch/ITSwitch.framework"
|
||||
install_framework "$BUILT_PRODUCTS_DIR/LetsMove/LetsMove.framework"
|
||||
install_framework "${BUILT_PRODUCTS_DIR}/ITSwitch/ITSwitch.framework"
|
||||
install_framework "${BUILT_PRODUCTS_DIR}/LetsMove/LetsMove.framework"
|
||||
install_framework "${BUILT_PRODUCTS_DIR}/STPrivilegedTask/STPrivilegedTask.framework"
|
||||
fi
|
||||
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
|
||||
wait
|
||||
|
||||
+31
-12
@@ -1,5 +1,13 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
|
||||
# If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
|
||||
# resources to, so exit 0 (signalling the script phase was successful).
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
|
||||
@@ -8,7 +16,11 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
|
||||
|
||||
XCASSET_FILES=()
|
||||
|
||||
case "${TARGETED_DEVICE_FAMILY}" in
|
||||
# This protects against multiple targets copying the same framework dependency at the same time. The solution
|
||||
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
|
||||
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
|
||||
|
||||
case "${TARGETED_DEVICE_FAMILY:-}" in
|
||||
1,2)
|
||||
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
|
||||
;;
|
||||
@@ -21,6 +33,9 @@ case "${TARGETED_DEVICE_FAMILY}" in
|
||||
3)
|
||||
TARGET_DEVICE_ARGS="--target-device tv"
|
||||
;;
|
||||
4)
|
||||
TARGET_DEVICE_ARGS="--target-device watch"
|
||||
;;
|
||||
*)
|
||||
TARGET_DEVICE_ARGS="--target-device mac"
|
||||
;;
|
||||
@@ -41,29 +56,29 @@ EOM
|
||||
fi
|
||||
case $RESOURCE_PATH in
|
||||
*.storyboard)
|
||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
|
||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
|
||||
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
|
||||
;;
|
||||
*.xib)
|
||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
|
||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
|
||||
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
|
||||
;;
|
||||
*.framework)
|
||||
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
|
||||
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
|
||||
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
;;
|
||||
*.xcdatamodel)
|
||||
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
|
||||
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
|
||||
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
|
||||
;;
|
||||
*.xcdatamodeld)
|
||||
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
|
||||
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
|
||||
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
|
||||
;;
|
||||
*.xcmappingmodel)
|
||||
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
|
||||
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
|
||||
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
|
||||
;;
|
||||
*.xcassets)
|
||||
@@ -71,7 +86,7 @@ EOM
|
||||
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
|
||||
;;
|
||||
*)
|
||||
echo "$RESOURCE_PATH"
|
||||
echo "$RESOURCE_PATH" || true
|
||||
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
|
||||
;;
|
||||
esac
|
||||
@@ -85,7 +100,7 @@ if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
|
||||
fi
|
||||
rm -f "$RESOURCES_TO_COPY"
|
||||
|
||||
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
|
||||
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
|
||||
then
|
||||
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
|
||||
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
|
||||
@@ -95,5 +110,9 @@ then
|
||||
fi
|
||||
done <<<"$OTHER_XCASSETS"
|
||||
|
||||
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
|
||||
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
else
|
||||
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_BUILD_DIR}/assetcatalog_generated_info.plist"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
CODE_SIGN_IDENTITY =
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/DJProgressHUD_OSX" "$PODS_CONFIGURATION_BUILD_DIR/ITSwitch" "$PODS_CONFIGURATION_BUILD_DIR/LetsMove"
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ITSwitch" "${PODS_CONFIGURATION_BUILD_DIR}/LetsMove" "${PODS_CONFIGURATION_BUILD_DIR}/STPrivilegedTask"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ITSwitch/ITSwitch.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/LetsMove/LetsMove.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/STPrivilegedTask/STPrivilegedTask.framework/Headers"
|
||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks'
|
||||
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/DJProgressHUD_OSX/DJProgressHUD_OSX.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ITSwitch/ITSwitch.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/LetsMove/LetsMove.framework/Headers"
|
||||
OTHER_LDFLAGS = $(inherited) -framework "DJProgressHUD_OSX" -framework "ITSwitch" -framework "LetsMove"
|
||||
PODS_BUILD_DIR = $BUILD_DIR
|
||||
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
OTHER_LDFLAGS = $(inherited) -framework "ITSwitch" -framework "LetsMove" -framework "QuartzCore" -framework "STPrivilegedTask" -framework "Security"
|
||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
|
||||
PODS_ROOT = ${SRCROOT}/Pods
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
CODE_SIGN_IDENTITY =
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/DJProgressHUD_OSX" "$PODS_CONFIGURATION_BUILD_DIR/ITSwitch" "$PODS_CONFIGURATION_BUILD_DIR/LetsMove"
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ITSwitch" "${PODS_CONFIGURATION_BUILD_DIR}/LetsMove" "${PODS_CONFIGURATION_BUILD_DIR}/STPrivilegedTask"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ITSwitch/ITSwitch.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/LetsMove/LetsMove.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/STPrivilegedTask/STPrivilegedTask.framework/Headers"
|
||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks'
|
||||
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/DJProgressHUD_OSX/DJProgressHUD_OSX.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ITSwitch/ITSwitch.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/LetsMove/LetsMove.framework/Headers"
|
||||
OTHER_LDFLAGS = $(inherited) -framework "DJProgressHUD_OSX" -framework "ITSwitch" -framework "LetsMove"
|
||||
PODS_BUILD_DIR = $BUILD_DIR
|
||||
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
OTHER_LDFLAGS = $(inherited) -framework "ITSwitch" -framework "LetsMove" -framework "QuartzCore" -framework "STPrivilegedTask" -framework "Security"
|
||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
|
||||
PODS_ROOT = ${SRCROOT}/Pods
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.1</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,5 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
@interface PodsDummy_STPrivilegedTask : NSObject
|
||||
@end
|
||||
@implementation PodsDummy_STPrivilegedTask
|
||||
@end
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifdef __OBJC__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#else
|
||||
#ifndef FOUNDATION_EXPORT
|
||||
#if defined(__cplusplus)
|
||||
#define FOUNDATION_EXPORT extern "C"
|
||||
#else
|
||||
#define FOUNDATION_EXPORT extern
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#import "STPrivilegedTask.h"
|
||||
|
||||
FOUNDATION_EXPORT double STPrivilegedTaskVersionNumber;
|
||||
FOUNDATION_EXPORT const unsigned char STPrivilegedTaskVersionString[];
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
framework module STPrivilegedTask {
|
||||
umbrella header "STPrivilegedTask-umbrella.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
CODE_SIGN_IDENTITY =
|
||||
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/STPrivilegedTask
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
OTHER_LDFLAGS = $(inherited) -framework "Security"
|
||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_ROOT = ${SRCROOT}
|
||||
PODS_TARGET_SRCROOT = ${PODS_ROOT}/STPrivilegedTask
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||
SKIP_INSTALL = YES
|
||||
@@ -1,13 +1,32 @@
|
||||
# Get It
|
||||
A native macOS video/audio downloader. Think of it as a youtube downloader that works on many sites.
|
||||
A macOS video/audio downloader. Think of it as a youtube downloader that works on many sites.
|
||||
|
||||
<img src="https://github.com/Kevin-De-Koninck/Get-It/blob/master/ReadMe%20Resources/MainWindow.png?raw=true" height="400" /><img src="https://github.com/Kevin-De-Koninck/Get-It/blob/master/ReadMe%20Resources/Settings.png?raw=true" height="400" />
|
||||
|
||||
**Note**: Get It requires _Homebrew_. The required dependencies will be installed with _Homebrew_.
|
||||
|
||||
# Installation
|
||||
|
||||
Download it [here](https://github.com/Kevin-De-Koninck/Get-It/releases/download/v0.5.3/Get.It.app.zip), unzip it and open it.
|
||||
If a yellow package button is visible on the main screen, click on it and follow the guide (to install the dependencies).
|
||||
Download it [here](https://github.com/Kevin-De-Koninck/Get-It/releases/download/v0.6.1/Get.It.app.zip), unzip it and open it.
|
||||
To install the dependencies required to run the software, please open the settings in the app and click on 'Install/update software'. This will not update Get It, but it will update all dependencies.
|
||||
|
||||
## dependencies
|
||||
|
||||
Get It requires the following dependencies which you can install from within the app, or using the command line yourself (see below).
|
||||
The following list is required:
|
||||
- xcode-select
|
||||
- brew
|
||||
- python
|
||||
- python3
|
||||
- pycrypt
|
||||
- youtube-dl
|
||||
- libav
|
||||
- ffmpeg
|
||||
|
||||
To install the dependencies yourself, open the Terminal app and paste the following command:
|
||||
``` bash
|
||||
if ! xcode-select -v &> /dev/null; then xcode-select --install; fi; if brew -v &> /dev/null; then brew update; else echo /usr/bin/ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'; fi; if brew ls --versions python &> /dev/null; then brew upgrade python; else brew install python; brew link python; fi; if brew ls --versions python3 &> /dev/null; then brew upgrade python3; else brew install python3; fi; if pip2.7 list | grep -i pycrypt &> /dev/null; then pip2.7 install pycrypt --upgrade; else pip2.7 install pycrypt; fi; if youtube-dl --version &> /dev/null; then brew upgrade youtube-dl; else brew install youtube-dl; fi; if brew list libav &> /dev/null; then brew upgrade libav; else brew install libav; fi; if brew list ffmpeg &> /dev/null; then brew upgrade ffmpeg; else brew install ffmpeg; fi
|
||||
```
|
||||
|
||||
|
||||
# About
|
||||
@@ -16,12 +35,19 @@ Get It will download audio and/or movies from many websites such as YouTube, BBC
|
||||
It will save your settings dynamically or you can restore the default settings. The default settings will download the audio from a video, convert it to an MP3 and save it to you downloads folder. This was, in my opinion, the mostly used setting.
|
||||
|
||||
|
||||
# Installation Guide
|
||||
|
||||
Get It will check if the dependencies that it needs are installed. If not all dependencies are installed, there will be a package icon in the main window that you can click. This button will load a simple installation guide that will guide you through the installation of the missing dependencies. If a dependency is already installed on your Mac, than the guide will not show this to avoid over complicating it.
|
||||
the following image is a screenshot of a step in the installation guide:
|
||||
<img src="https://github.com/Kevin-De-Koninck/Get-It/blob/master/ReadMe%20Resources/InstallationGuide.png?raw=true" width="400" />
|
||||
# Submit a bug
|
||||
|
||||
You can submit a bug here on Github. Please provide the following:
|
||||
- The URL(s) that you try to download.
|
||||
- Your settings.
|
||||
|
||||
Also, open the Terminal app on your MacBook and issue the following command:
|
||||
```
|
||||
cat /tmp/getit_logs
|
||||
```
|
||||
|
||||
Provide the output of the first command of you have an issue while installing the required software and provide the output of the second command of you have problems while downloading your URLs.
|
||||
|
||||
# THANKS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user