mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Automated ingestion of latest Fleet-maintained app data. Co-authored-by: jahzielv <19838370+jahzielv@users.noreply.github.com>
19 lines
No EOL
3.4 KiB
JSON
19 lines
No EOL
3.4 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"version": "2.25.6.72",
|
|
"queries": {
|
|
"exists": "SELECT 1 FROM apps WHERE bundle_identifier = 'net.whatsapp.WhatsApp';"
|
|
},
|
|
"installer_url": "https://web.whatsapp.com/desktop/mac_native/release/?version=2.25.6.72\u0026extension=zip\u0026configuration=Release\u0026branch=relbranch",
|
|
"unique_identifier": "net.whatsapp.WhatsApp",
|
|
"install_script_ref": "855416a1",
|
|
"uninstall_script_ref": "1601899d",
|
|
"sha256": "b5e741a86282073ac76e1998e1422f8464b2f22be11a911caf187951364e7f32"
|
|
}
|
|
],
|
|
"refs": {
|
|
"1601899d": "#!/bin/sh\n\n# variables\nAPPDIR=\"/Applications/\"\nLOGGED_IN_USER=$(scutil \u003c\u003c\u003c \"show State:/Users/ConsoleUser\" | awk '/Name :/ { print $3 }')\n# functions\n\ntrash() {\n local logged_in_user=\"$1\"\n local target_file=\"$2\"\n local timestamp=\"$(date +%Y-%m-%d-%s)\"\n local rand=\"$(jot -r 1 0 99999)\"\n\n # replace ~ with /Users/$logged_in_user\n if [[ \"$target_file\" == ~* ]]; then\n target_file=\"/Users/$logged_in_user${target_file:1}\"\n fi\n\n local trash=\"/Users/$logged_in_user/.Trash\"\n local file_name=\"$(basename \"${target_file}\")\"\n\n if [[ -e \"$target_file\" ]]; then\n echo \"removing $target_file.\"\n mv -f \"$target_file\" \"$trash/${file_name}_${timestamp}_${rand}\"\n else\n echo \"$target_file doesn't exist.\"\n fi\n}\n\nsudo rm -rf \"$APPDIR/WhatsApp.app\"\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/net.whatsapp.WhatsApp*'\ntrash $LOGGED_IN_USER '~/Library/Caches/net.whatsapp.WhatsApp'\ntrash $LOGGED_IN_USER '~/Library/Containers/net.whatsapp.WhatsApp*'\ntrash $LOGGED_IN_USER '~/Library/Group Containers/group.com.facebook.family'\ntrash $LOGGED_IN_USER '~/Library/Group Containers/group.net.whatsapp*'\ntrash $LOGGED_IN_USER '~/Library/Saved Application State/net.whatsapp.WhatsApp.savedState'\n",
|
|
"855416a1": "#!/bin/sh\n\n# variables\nAPPDIR=\"/Applications/\"\nTMPDIR=$(dirname \"$(realpath $INSTALLER_PATH)\")\n# functions\n\nquit_application() {\n local bundle_id=\"$1\"\n local timeout_duration=10\n\n # check if the application is running\n if ! osascript -e \"application id \\\"$bundle_id\\\" is running\" 2\u003e/dev/null; then\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ $EUID -eq 0 \u0026\u0026 \"$console_user\" == \"root\" ]]; then\n echo \"Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'.\"\n return\n fi\n\n echo \"Quitting application '$bundle_id'...\"\n\n # try to quit the application within the timeout period\n local quit_success=false\n SECONDS=0\n while (( SECONDS \u003c timeout_duration )); do\n if osascript -e \"tell application id \\\"$bundle_id\\\" to quit\" \u003e/dev/null 2\u003e\u00261; then\n if ! pgrep -f \"$bundle_id\" \u003e/dev/null 2\u003e\u00261; then\n echo \"Application '$bundle_id' quit successfully.\"\n quit_success=true\n break\n fi\n fi\n sleep 1\n done\n\n if [[ \"$quit_success\" = false ]]; then\n echo \"Application '$bundle_id' did not quit.\"\n fi\n}\n\n\n# extract contents\nunzip \"$INSTALLER_PATH\" -d \"$TMPDIR\"\n# copy to the applications folder\nquit_application 'net.whatsapp.WhatsApp'\nsudo [ -d \"$APPDIR/WhatsApp.app\" ] \u0026\u0026 sudo mv \"$APPDIR/WhatsApp.app\" \"$TMPDIR/WhatsApp.app.bkp\"\nsudo cp -R \"$TMPDIR/WhatsApp.app\" \"$APPDIR\"\n"
|
|
}
|
|
} |