Skip to content

Instantly share code, notes, and snippets.

@skaag
Created March 3, 2026 22:29
Show Gist options
  • Select an option

  • Save skaag/6b938ff85d4d37b7ba96c83344813256 to your computer and use it in GitHub Desktop.

Select an option

Save skaag/6b938ff85d4d37b7ba96c83344813256 to your computer and use it in GitHub Desktop.
Cleans up Akool Live Camera device left behind after uninstalling the Akool Live Camera app
#!/bin/bash
#
# cleanup-akool.sh — Remove all remnants of the Akool Live Camera app
#
# What it does:
# 1. Deactivates and uninstalls the Akool virtual camera system extension
# (this is the "rogue video device" that shows up in apps like Zoom, FaceTime, etc.)
# 2. Removes Akool's Application Support folder (configs, avatars, face data, logs)
# 3. Removes the preferences plist (contains stale auth tokens — a security concern)
# 4. Optionally removes Chrome IndexedDB data for akool.com
#
# Requirements:
# - Must be run with sudo (system extension removal requires root)
# - SIP does NOT need to be disabled on modern macOS
#
# Usage:
# sudo bash cleanup-akool.sh [--include-browser-data]
#
set -euo pipefail
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
INCLUDE_BROWSER_DATA=false
if [[ "${1:-}" == "--include-browser-data" ]]; then
INCLUDE_BROWSER_DATA=true
fi
USER_HOME="$HOME"
# When running under sudo, resolve the real user's home directory
if [[ -n "${SUDO_USER:-}" ]]; then
USER_HOME=$(eval echo "~${SUDO_USER}")
fi
echo ""
echo "======================================"
echo " Akool Live Camera Cleanup Script"
echo "======================================"
echo ""
# --- Step 1: Uninstall the system extension (virtual camera) ---
echo -e "${YELLOW}[1/4]${NC} Checking for Akool system extension..."
TEAM_ID="W2QB5J946L"
BUNDLE_ID="com.akool.livecamera.mac.extension"
if systemextensionsctl list 2>/dev/null | grep -q "$BUNDLE_ID"; then
echo " Found active system extension: $BUNDLE_ID"
echo " Requesting deactivation and uninstall..."
if [[ $EUID -ne 0 ]]; then
echo -e " ${RED}ERROR: Must run with sudo to remove system extensions.${NC}"
echo " Re-run: sudo bash $0"
exit 1
fi
systemextensionsctl uninstall "$TEAM_ID" "$BUNDLE_ID" 2>&1 && \
echo -e " ${GREEN}OK${NC} — System extension uninstall requested." || \
echo -e " ${YELLOW}WARN${NC} — uninstall command returned an error (may need a reboot to finalize)."
# Also remove the on-disk bundle if it still exists
SYSEXT_DIR="/Library/SystemExtensions/BE5BA9B8-E58C-4F63-919D-6FCB6222CC29"
if [[ -d "$SYSEXT_DIR" ]]; then
rm -rf "$SYSEXT_DIR"
echo -e " ${GREEN}OK${NC} — Removed extension bundle from $SYSEXT_DIR"
fi
else
echo -e " ${GREEN}OK${NC} — No Akool system extension found (already removed)."
fi
# --- Step 2: Remove Application Support data ---
echo ""
echo -e "${YELLOW}[2/4]${NC} Removing Application Support data..."
APP_SUPPORT_DIR="$USER_HOME/Library/Application Support/Akool Live Camera"
if [[ -d "$APP_SUPPORT_DIR" ]]; then
rm -rf "$APP_SUPPORT_DIR"
echo -e " ${GREEN}OK${NC} — Removed $APP_SUPPORT_DIR"
else
echo -e " ${GREEN}OK${NC} — Already clean (not found)."
fi
# --- Step 3: Remove preferences (contains stale auth tokens) ---
echo ""
echo -e "${YELLOW}[3/4]${NC} Removing preferences plist..."
PREF_FILE="$USER_HOME/Library/Preferences/com.akool-camera.authmodule.plist"
if [[ -f "$PREF_FILE" ]]; then
rm -f "$PREF_FILE"
echo -e " ${GREEN}OK${NC} — Removed $PREF_FILE"
echo -e " ${GREEN}OK${NC} — (This contained stale JWT and refresh tokens — now cleaned.)"
else
echo -e " ${GREEN}OK${NC} — Already clean (not found)."
fi
# --- Step 4: Optionally remove Chrome browser data ---
echo ""
echo -e "${YELLOW}[4/4]${NC} Chrome IndexedDB data for akool.com..."
if $INCLUDE_BROWSER_DATA; then
CHROME_SUPPORT="$USER_HOME/Library/Application Support/Google/Chrome"
found_any=false
while IFS= read -r -d '' db_dir; do
rm -rf "$db_dir"
echo -e " ${GREEN}OK${NC} — Removed $db_dir"
found_any=true
done < <(find "$CHROME_SUPPORT" -type d -name "*akool.com*" -print0 2>/dev/null)
if ! $found_any; then
echo -e " ${GREEN}OK${NC} — No Chrome data found."
fi
else
echo " Skipped (pass --include-browser-data to also clean Chrome site data)."
fi
# --- Done ---
echo ""
echo "======================================"
echo -e " ${GREEN}Cleanup complete!${NC}"
echo "======================================"
echo ""
echo "NOTE: You may need to restart (or log out and back in) for the"
echo " virtual camera device to fully disappear from applications."
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment