Skip to content

Commit

Permalink
Merge branch 'release/1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ygini committed Oct 1, 2020
2 parents 19f50d1 + defb55a commit d36dfa3
Show file tree
Hide file tree
Showing 30 changed files with 735 additions and 128 deletions.
9 changes: 9 additions & 0 deletions example/EasterEggs/icanhazdadjokes/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## icanhazdadjoke
---
##### Author: [Zack McCauley](https://www.github.com/wardsparadox)

### Description:
Curls on click icanhazdadjoke.com's API for a fun joke
Would recommend using the optionalDisplay:true keys to hide it

### Preference Keys
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# Pending Updates Script for Managed Software Center
### The following line load the Hello IT bash script lib
. "$HELLO_IT_SCRIPT_SH_LIBRARY/com.github.ygini.hello-it.scriptlib.sh"

function displayJoke {
osascript -e "display dialog \"$(curl -s -H "User-Agent: HelloIT" -H "Accept: text/plain" https://icanhazdadjoke.com/)\" buttons {\"Haha\"} with icon POSIX file \"/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ErasingIcon.icns\""
}


function onClickAction {
displayJoke
}

function setTitleAction {
updateTitle "Would you like to see a joke?"
updateState "${STATE[4]}"
updateTooltip "Brought to you by icanhazdadjoke.com"
}

### The only things to do outside of a bash function is to call the main function defined by the Hello IT bash lib.
main "$@"

exit 0
8 changes: 2 additions & 6 deletions example/HelloITConfiguration_example.mobileconfig
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<string>com.github.ygini.hello-it.computerdetails.storagespace.sh</string>
<key>title</key>
<string>storagespace</string>
<key>periodic-run</key>
<key>repeat</key>
<integer>3600</integer>
</dict>
</dict>
Expand Down Expand Up @@ -146,8 +146,6 @@
<string>com.github.ygini.hello-it.ip.sh</string>
<key>repeat</key>
<integer>60</integer>
<key>periodic-run</key>
<integer>60</integer>
</dict>
</dict>
<dict>
Expand All @@ -168,8 +166,6 @@
<string>com.github.ygini.hello-it.networkdetails.macaddress.sh</string>
<key>repeat</key>
<integer>60</integer>
<key>periodic-run</key>
<integer>60</integer>
</dict>
</dict>
</array>
Expand Down Expand Up @@ -204,7 +200,7 @@
<dict>
<key>script</key>
<string>com.github.ygini.hello-it.munki.pendingmscupdates.sh</string>
<key>periodic-run</key>
<key>repeat</key>
<integer>360</integer>
<key>title</key>
<string>pendingupdatescount</string>
Expand Down
2 changes: 1 addition & 1 deletion example/computer_details/ComputerUpTime/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Click to show a prompt to restart.
<string>com.github.wardsparadox.hello-it.computerdetails.uptime.sh</string>
<key>title</key>
<string>uptime</string>
<key>periodic-run</key>
<key>repeat</key>
<integer>3600</integer>
</dict>
</dict>
2 changes: 1 addition & 1 deletion example/munki_related/MSC Pending Updates/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Provides user feedback as to how many Managed Software Center updates are availa
<dict>
<key>script</key>
<string>com.github.wardsparadox.hello-it.munki.pendingmscupdates.sh</string>
<key>periodic-run</key>
<key>repeat</key>
<integer>360</integer>
<key>title</key>
<string>pendingupdatescount</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dict>
<key>script</key>
<string>com.github.wardsparadox.hello-it.munki.pendingmscupdates.sh</string>
<key>periodic-run</key>
<key>repeat</key>
<integer>360</integer>
<key>title</key>
<string>pendingupdatescount</string>
Expand Down
30 changes: 25 additions & 5 deletions package/BuildAndPackage.command
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
CONFIGURATION="Release"

DEFAULT_DEVELOPER_ID_INSTALLER="Developer ID Installer: Yoann GINI (CRXPBZF3N4)"
DEFAULT_DEVELOPER_ID_APP="Developer ID Application: Yoann GINI (CRXPBZF3N4)"
DEVELOPER_ID_INSTALLER=${CUSTOM_DEVELOPER_ID_INSTALLER:-${DEFAULT_DEVELOPER_ID_INSTALLER}}
DEVELOPER_ID_APP=${CUSTOM_DEVELOPER_ID_APP:-${DEFAULT_DEVELOPER_ID_APP}}

NOTARIZATION_DEFAULT_DEVELOPER_ID_LOGIN="yoann.gini@gmail.com"
NOTARIZATION_DEVELOPER_ID_LOGIN=${NOTARIZATION_CUSTOM_DEVELOPER_ID_LOGIN:-${NOTARIZATION_DEFAULT_DEVELOPER_ID_LOGIN}}
Expand Down Expand Up @@ -185,6 +187,12 @@ RELEASE_DSYM_LOCATION="${RELEASE_LOCATION}/dSYM"

PKG_ROOT="$(mktemp -d)"

if [[ -d "${RELEASE_LOCATION}" ]]
then
echo "Previous build found, cleaning all related files"
rm -rf "${RELEASE_LOCATION}"
fi

mkdir -p "${BUILT_PRODUCTS_DIR}/dSYM"
mkdir -p "${BUILT_PRODUCTS_DIR}/Products"
mkdir -p "${RELEASE_PRODUCT_LOCATION}"
Expand All @@ -200,25 +208,32 @@ echo "### Start building Hello IT"

xcodebuild -UseModernBuildSystem=NO -quiet -project "${PROJECT_DIR}/Hello IT.xcodeproj" -configuration ${CONFIGURATION} -target "Hello IT" CONFIGURATION_TEMP_DIR="${BUILT_PRODUCTS_DIR}/Intermediates" CONFIGURATION_BUILD_DIR="${BUILT_PRODUCTS_DIR}/Products" DWARF_DSYM_FOLDER_PATH="${BUILT_PRODUCTS_DIR}/dSYM" OTHER_CODE_SIGN_FLAGS="--timestamp"

cp -r "${BUILT_PRODUCTS_DIR}/Products/Hello IT.app" "${RELEASE_PRODUCT_LOCATION}"
if [[ $? != 0 ]]; then
echo "Building failed"
exit 1
fi

cp -a "${BUILT_PRODUCTS_DIR}/Products/Hello IT.app" "${RELEASE_PRODUCT_LOCATION}"

codesign --deep --force --verbose --timestamp --options runtime --sign "${DEVELOPER_ID_APP}" "${RELEASE_PRODUCT_LOCATION}/Hello IT.app"

echo ""
echo ""


cp -r "${BUILT_PRODUCTS_DIR}/dSYM" "${RELEASE_DSYM_LOCATION}"
cp -a "${BUILT_PRODUCTS_DIR}/dSYM" "${RELEASE_DSYM_LOCATION}"

echo "####### Create package from build"

mkdir -p "${PKG_ROOT}//Applications/Utilities"
cp -r "${RELEASE_PRODUCT_LOCATION}/Hello IT.app" "${PKG_ROOT}/Applications/Utilities"
cp -a "${RELEASE_PRODUCT_LOCATION}/Hello IT.app" "${PKG_ROOT}/Applications/Utilities"

mkdir -p "${PKG_ROOT}/Library/Application Support/com.github.ygini.hello-it/CustomImageForItem"
mkdir -p "${PKG_ROOT}/Library/Application Support/com.github.ygini.hello-it/CustomStatusBarIcon"
cp -r "${PROJECT_DIR}/Plugins/ScriptedItem/CustomScripts" "${PKG_ROOT}/Library/Application Support/com.github.ygini.hello-it"
cp -a "${PROJECT_DIR}/Plugins/ScriptedItem/CustomScripts" "${PKG_ROOT}/Library/Application Support/com.github.ygini.hello-it"

mkdir -p "${PKG_ROOT}/Library/LaunchAgents"
cp -r "${GIT_ROOT_DIR}/package/LaunchAgents/com.github.ygini.hello-it.plist" "${PKG_ROOT}/Library/LaunchAgents"
cp -a "${GIT_ROOT_DIR}/package/LaunchAgents/com.github.ygini.hello-it.plist" "${PKG_ROOT}/Library/LaunchAgents"

#sudo chown -R root:wheel "${PKG_ROOT}"

Expand All @@ -231,6 +246,11 @@ pkgbuild --component-plist "${PBK_BUILD_COMPONENT}" --sign "${DEVELOPER_ID_INSTA

productbuild --product "${GIT_ROOT_DIR}/package/requirements.plist" --sign "${DEVELOPER_ID_INSTALLER}" --version "${PKG_VERSION}" --package "${RELEASE_LOCATION}/Hello-IT-${PKG_VERSION}-${CONFIGURATION}.pkg" "${RELEASE_LOCATION}/Hello-IT-${PKG_VERSION}-${CONFIGURATION}-Distribution.pkg"

if [[ $? != 0 ]]; then
echo "Package creation failed"
exit 1
fi

rm "${RELEASE_LOCATION}/Hello-IT-${PKG_VERSION}-${CONFIGURATION}.pkg"

notarizePayloadWithBundleID "${RELEASE_LOCATION}/Hello-IT-${PKG_VERSION}-${CONFIGURATION}-Distribution.pkg" "com.github.ygini.hello-it"
Expand Down
6 changes: 3 additions & 3 deletions src/HITDevKit/HITDevKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
E1B2C8C81B59351B005A9936 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1140;
ORGANIZATIONNAME = "Yoann Gini (Open Source Project)";
TargetAttributes = {
E1B2C8D01B59351B005A9936 = {
Expand Down Expand Up @@ -415,7 +415,7 @@
E1B2C8E81B59351B005A9936 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
Expand All @@ -437,7 +437,7 @@
E1B2C8E91B59351B005A9936 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
Expand Down
4 changes: 2 additions & 2 deletions src/HITDevKit/HITDevKit/HITBasicPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "HITBasicPlugin.h"

#define kHITPPptionalDisplay @"optionalDisplay"
#define kHITPOptionalDisplay @"optionalDisplay"

@interface HITBasicPlugin () {
NSMenuItem *_menuItem;
Expand All @@ -33,7 +33,7 @@ - (instancetype)initWithSettings:(NSDictionary*)settings
_allowedToRun = YES;
_settings = settings;

_optionalDisplay = [[settings objectForKey:kHITPPptionalDisplay] boolValue];
_optionalDisplay = [[settings objectForKey:kHITPOptionalDisplay] boolValue];
}
return self;
}
Expand Down
2 changes: 1 addition & 1 deletion src/HITDevKit/HITDevKit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>351</string>
<string>367</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2015 Yoann Gini (Open Source Project). All rights reserved.</string>
<key>NSPrincipalClass</key>
Expand Down
43 changes: 43 additions & 0 deletions src/Hello IT.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
F8340B9F1C96CF9000C820D7 /* statusbar@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F8340B8B1C96CF9000C820D7 /* statusbar@2x.png */; };
F84238FF20C8748200FB5410 /* CachetHQComponent.hitp in Copy Default Plugins */ = {isa = PBXBuildFile; fileRef = F8D61B8A20C8731A00DE2453 /* CachetHQComponent.hitp */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
F89B593B1DA7DC350028D75F /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = F89B593A1DA7DC350028D75F /* Reachability.m */; };
F8F07637244EEFA200E3DF7B /* Command.hitp in Copy Default Plugins */ = {isa = PBXBuildFile; fileRef = F89A03522368A51D0059281B /* Command.hitp */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -146,6 +147,20 @@
remoteGlobalIDString = F83294A41F773076009DA574;
remoteInfo = ADPass;
};
F89A03512368A51D0059281B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F89A034C2368A51C0059281B /* Command.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = F89A03432368A51C0059281B;
remoteInfo = Command;
};
F8A258762452F66B00BB8A05 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F89A034C2368A51C0059281B /* Command.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = F89A03422368A51C0059281B;
remoteInfo = Command;
};
F8CF084221A729190070C049 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F8D61B8520C8731A00DE2453 /* CachetHQ.xcodeproj */;
Expand Down Expand Up @@ -232,6 +247,7 @@
dstPath = "";
dstSubfolderSpec = 13;
files = (
F8F07637244EEFA200E3DF7B /* Command.hitp in Copy Default Plugins */,
F84238FF20C8748200FB5410 /* CachetHQComponent.hitp in Copy Default Plugins */,
F83294DD1F7736B5009DA574 /* ADPass.hitp in Copy Default Plugins */,
E14B67DA1B59110D00941A27 /* ScriptedItem.hitp in Copy Default Plugins */,
Expand Down Expand Up @@ -302,6 +318,7 @@
F8340B891C96CF9000C820D7 /* statusbar-warning@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "statusbar-warning@2x.png"; sourceTree = "<group>"; };
F8340B8A1C96CF9000C820D7 /* statusbar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = statusbar.png; sourceTree = "<group>"; };
F8340B8B1C96CF9000C820D7 /* statusbar@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "statusbar@2x.png"; sourceTree = "<group>"; };
F89A034C2368A51C0059281B /* Command.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Command.xcodeproj; path = Command/Command.xcodeproj; sourceTree = "<group>"; };
F89B59391DA7DC350028D75F /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = "<group>"; };
F89B593A1DA7DC350028D75F /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = "<group>"; };
F8B315891FA6BB1400839784 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/MainMenu.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -354,6 +371,7 @@
E17743301B51E6E600A5B406 /* Plugins */ = {
isa = PBXGroup;
children = (
F89A034C2368A51C0059281B /* Command.xcodeproj */,
F8D61B8520C8731A00DE2453 /* CachetHQ.xcodeproj */,
F83294AE1F773076009DA574 /* ADPass.xcodeproj */,
E17743591B51EA8500A5B406 /* OpenResource.xcodeproj */,
Expand Down Expand Up @@ -516,6 +534,14 @@
name = statusbar;
sourceTree = "<group>";
};
F89A034D2368A51C0059281B /* Products */ = {
isa = PBXGroup;
children = (
F89A03522368A51D0059281B /* Command.hitp */,
);
name = Products;
sourceTree = "<group>";
};
F8D61B8620C8731A00DE2453 /* Products */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -543,6 +569,7 @@
);
dependencies = (
F8F4E5771F1A73CC004E8789 /* PBXTargetDependency */,
F8A258772452F66B00BB8A05 /* PBXTargetDependency */,
F842390220C8748800FB5410 /* PBXTargetDependency */,
F86CCC0B1F790D250043CF55 /* PBXTargetDependency */,
F8F4E5791F1A73CC004E8789 /* PBXTargetDependency */,
Expand Down Expand Up @@ -623,6 +650,10 @@
ProductGroup = F8D61B8620C8731A00DE2453 /* Products */;
ProjectRef = F8D61B8520C8731A00DE2453 /* CachetHQ.xcodeproj */;
},
{
ProductGroup = F89A034D2368A51C0059281B /* Products */;
ProjectRef = F89A034C2368A51C0059281B /* Command.xcodeproj */;
},
{
ProductGroup = E1B2C8EE1B59351B005A9936 /* Products */;
ProjectRef = E1B2C8ED1B59351B005A9936 /* HITDevKit.xcodeproj */;
Expand Down Expand Up @@ -746,6 +777,13 @@
remoteRef = F83294B21F773078009DA574 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F89A03522368A51D0059281B /* Command.hitp */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = Command.hitp;
remoteRef = F89A03512368A51D0059281B /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F8CF084321A729190070C049 /* CachetHQIncidents.hitp */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
Expand Down Expand Up @@ -856,6 +894,11 @@
name = ADPass;
targetProxy = F86CCC0A1F790D250043CF55 /* PBXContainerItemProxy */;
};
F8A258772452F66B00BB8A05 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = Command;
targetProxy = F8A258762452F66B00BB8A05 /* PBXContainerItemProxy */;
};
F8F4E5771F1A73CC004E8789 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = HITDevKit;
Expand Down
4 changes: 2 additions & 2 deletions src/Hello IT/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.4</string>
<string>1.5.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>351</string>
<string>367</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
22 changes: 22 additions & 0 deletions src/Plugins/ADPass/ADPass.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
isa = PBXNativeTarget;
buildConfigurationList = F83294AB1F773076009DA574 /* Build configuration list for PBXNativeTarget "ADPass" */;
buildPhases = (
F89A03592368A5CF0059281B /* GitVersion */,
F83294A11F773076009DA574 /* Sources */,
F83294A21F773076009DA574 /* Frameworks */,
F83294A31F773076009DA574 /* Resources */,
Expand Down Expand Up @@ -140,6 +141,27 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
F89A03592368A5CF0059281B /* GitVersion */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = GitVersion;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -o errexit\nset -o nounset\n\nVERSION=$(git rev-list HEAD | wc -l)\n\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $VERSION\" \"${INFOPLIST_FILE}\"\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
F83294A11F773076009DA574 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down
Loading

0 comments on commit d36dfa3

Please sign in to comment.