#!/bin/bash

# Target binary path fragment
TARGET_PATH="WhatsApp.app/PlugIns/ServiceExtension.appex/ServiceExtension"

# Find the PID of the process with that exact path
PID=$(ps aux | grep "$TARGET_PATH" | grep -v grep | tr -s ' ' | cut -d' ' -f2)

# Kill it if running
if [ -n "$PID" ]; then
    echo "Killing WhatsApp ServiceExtension: PID $PID"
    kill -9 "$PID"
else
    echo "No WhatsApp ServiceExtension process found."
fi

exit 0
