Home > Mac administration, Scripting > Adobe Flash is dead – let’s get it removed

Adobe Flash is dead – let’s get it removed

After 24 years and 1078 known security vulnerabilities, Adobe Flash has reached end of life status as of December 31, 2020.

Screen Shot 2021 01 01 at 1 25 22 PM

To assist with the process of removing Adobe Flash, I’ve written an uninstall script which will completely remove Adobe Flash. For more details, please see below the jump.

This script is designed to uninstall the Adobe Flash plug-ins and their associated components. As part of this, it runs the following actions:

  1. Stop Adobe Flash Install Manager
  2. If running, unload the launchdaemon used by the Adobe Flash update process.
  3. Remove the Adobe Flash plug-ins, Adobe Flash Install Manager and their associated components.
  4. Remove Adobe Flash preference pane settings at the user level.
  5. Forget the installer package receipts.

The script is available below and at the following address on GitHub:

https://github.com/rtrouton/rtrouton_scripts/tree/master/rtrouton_scripts/uninstallers/adobe_flash_uninstall

#!/bin/bash
# This script uninstalls Adobe Flash software
AdobeFlashUninstall (){
echo "Uninstalling Adobe Flash software…"
# kill the Adobe Flash Player Install Manager
echo "Stopping Adobe Flash Install Manager."
killall "Adobe Flash Player Install Manager"
if [[ -f "/Library/LaunchDaemons/com.adobe.fpsaud.plist" ]]; then
echo "Stopping Adobe Flash update process."
/bin/launchctl bootout system "/Library/LaunchDaemons/com.adobe.fpsaud.plist"
fi
if [[ -f "/Library/Application Support/Macromedia/mms.cfg" ]]; then
echo "Deleting Adobe Flash update preferences."
rm "/Library/Application Support/Macromedia/mms.cfg"
fi
if [[ -e "/Library/Application Support/Adobe/Flash Player Install Manager/fpsaud" ]]; then
echo "Deleting Adobe software update app and support files."
rm "/Library/LaunchDaemons/com.adobe.fpsaud.plist"
rm "/Library/Application Support/Adobe/Flash Player Install Manager/FPSAUConfig.xml"
rm "/Library/Application Support/Adobe/Flash Player Install Manager/fpsaud"
fi
if [[ -e "/Library/Internet Plug-Ins/Flash Player.plugin" ]]; then
echo "Deleting NPAPI browser plug-in files."
rm -Rf "/Library/Internet Plug-Ins/Flash Player.plugin"
rm -Rf "/Library/Internet Plug-Ins/Flash Player Enabler.plugin"
rm "/Library/Internet Plug-Ins/flashplayer.xpt"
fi
if [[ -e "/Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin" ]]; then
echo "Deleting PPAPI browser plug-in files."
rm -Rf "/Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin"
rm "/Library/Internet Plug-Ins/PepperFlashPlayer/manifest.json"
fi
if [[ -e "/Library/PreferencePanes/Flash Player.prefPane" ]]; then
echo "Deleting Flash Player preference pane from System Preferences."
rm -Rf "/Library/PreferencePanes/Flash Player.prefPane"
fi
# Removing Adobe Flash preference pane settings at user level
allLocalUsers=$(/usr/bin/dscl . -list /Users UniqueID | awk '$2>500 {print $1}')
for userName in ${allLocalUsers}; do
# get path to user's home directory
userHome=$(/usr/bin/dscl . -read "/Users/$userName" NFSHomeDirectory 2>/dev/null | /usr/bin/sed 's/^[^\/]*//g')
/usr/bin/defaults delete "${userHome}/Library/Preferences/com.apple.systempreferences.plist" com.adobe.preferences.flashplayer 2>/dev/null
done
#Remove receipts
rm -Rf /Library/Receipts/*FlashPlayer*
pkgutil –forget com.adobe.pkg.FlashPlayer >/dev/null 2>&1
pkgutil –forget com.adobe.pkg.PepperFlashPlayer >/dev/null 2>&1
# Remove Adobe Flash Player Install Manager.app
if [[ -e "/Applications/Utilities/Adobe Flash Player Install Manager.app" ]]; then
echo "Deleting the Adobe Flash Player Install Manager app."
rm -Rf "/Applications/Utilities/Adobe Flash Player Install Manager.app"
fi
echo "Uninstall completed successfully."
}
# Set exit error code
ERROR=0
# Check to see if Adobe Flash sofware is installed by locating either the Flash NPAPI or PPAPI browser
# plug-ins in /Library/Internet Plug-Ins or the Adobe Flash Player Install Manager.app in /Applications/Utilities
if [[ -e "/Library/Internet Plug-Ins/Flash Player.plugin" ]] || [[ -e "/Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin" ]] || [[ -e "/Applications/Utilities/Adobe Flash Player Install Manager.app" ]]; then
# Run the Adobe Flash Player software uninstaller
AdobeFlashUninstall
if [[ $? -eq 0 ]]; then
echo "Adobe Flash Player uninstalled successfully."
else
echo "Error: Failed to uninstall Adobe Flash Player software."
ERROR=1
fi
else
echo "Error: Adobe Flash Player software is not installed."
ERROR=1
fi
exit $ERROR

  1. Patrick Fergus
    January 1, 2021 at 7:12 pm

    I haven’t used this myself (I also had a removal script prior to hearing about it) but there’s also the option to use Adobe’s uninstall methodology:

    “/Applications/Utilities/Adobe Flash Player Install Manager.app/Contents/MacOS/Adobe Flash Player Install Manager” -uninstall

    Taken from this post:

    https://www.jamf.com/jamf-nation/discussions/35141/good-riddance-flash#responseChild200891

    Also “…Adobe will block Flash content from running in Flash Player beginning January 12, 2021…” (by refusing to run, but _not_ by uninstalling itself) per:

    https://www.adobe.com/products/flashplayer/end-of-life.html

    Heroic methods to force Flash Player to run after January 12, 2021 are detailed in the “Enterprise Enablement” section in the Flash Player Administration Guide (but nobody really should be doing that):

    Click to access flash_player_32_0_admin_guide.pdf

  2. donnyh15
    January 2, 2021 at 4:24 pm

    I’m getting “unable to execute ./adobe_flash_uninstall.sh: Operation not permitted” and ls yields: -rwxr–r–@ 1 deh staff 2970 Jan 2 10:10 adobe_flash_uninstall.sh*

    • HildahlP
      January 2, 2021 at 7:47 pm

      You should make the script executable by setting the executable bit chmod +x /adobe_flash_uninstall.sh then ls -al should yield rwxr-xr-x

    • bhal
      January 2, 2021 at 7:56 pm

      chmod +X adobe_flash_uninstall.sh

      • donnyh15
        January 2, 2021 at 8:43 pm

        I missed something in my copying. already did chmod +x. The operation not permitted still comes thru.

    • fiwswe
      January 5, 2021 at 5:11 am

      Did you run the script as root (sudo ./adobe_flash_uninstall.sh)?
      Worked fine here.

  3. Simone Manganelli
    January 12, 2021 at 9:37 pm

    It should be pkgutil –forget (with two dashes). The script on GitHub seems fine but as presented here in this post it looks like it only has one dash. ¯\_(ツ)_/¯

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: