mirror of
https://github.com/NohamR/pyzule-rw.git
synced 2026-10-10 18:39:41 +00:00
feat: remove watch apps
This commit is contained in:
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user