feat: remove watch apps

This commit is contained in:
zx
2024-09-06 00:04:23 -04:00
parent 9d3f12f447
commit df3ec4ba2b
4 changed files with 43 additions and 0 deletions

View File

@@ -1,3 +1,6 @@
import os
import shutil
from cyan.tbhutils import get_plist
from .executable import Executable
@@ -12,3 +15,26 @@ class AppBundle:
path
)
def remove(self, name: str) -> bool:
path = f"{self.path}/{name}"
if not os.path.exists(path):
return False
try:
shutil.rmtree(path)
except NotADirectoryError:
os.remove(path)
return True
def remove_watch_apps(self) -> None:
removed = False
for name in ("Watch", "WatchKit", "com.apple.WatchPlaceholder"):
if self.remove(name):
removed = True
if removed:
print("[*] removed watch app")
else:
print("[?] watch app not present")