This commit is contained in:
Jason Ross
2025-08-25 11:18:48 -05:00
parent d3106ad238
commit 3f1882eacd
3 changed files with 15 additions and 8 deletions
+1
View File
@@ -0,0 +1 @@
src/platform-tools
Generated
+1 -1
View File
@@ -159,4 +159,4 @@ zstd = ["zstandard (>=0.18.0)"]
[metadata]
lock-version = "2.1"
python-versions = ">=3.8"
content-hash = "a012451d67da318b63f6c15053d517c2c88eea8168f134d2a46d3a5fa8ab0ed5"
content-hash = "22724479fe8e759bcc703c31941828fa61f965e7af8dd57a4e89ea454887ddca"
+13 -7
View File
@@ -19,23 +19,29 @@ else:
ADB_BINARY_PATH = os.path.join(LOCAL_ADB_FOLDER, "platform-tools", ADB_BINARY_NAME)
def check_local_disk_space(self):
def check_local_disk_space():
try:
# Check available disk space
free_space = shutil.disk_usage(LOCAL_ADB_FOLDER)[2]
if free_space < 50 * 1024 * 1024: # 50MB minimum
raise self.report_error("Insufficient disk space") & Exception("Insufficient disk space")
def download_and_extract_adb(self):
raise Exception("Insufficient disk space")
except OSError:
# Create directory if it doesn't exist
os.makedirs(LOCAL_ADB_FOLDER, exist_ok=True)
def download_and_extract_adb():
if os.path.isfile(ADB_BINARY_PATH):
return True
try:
# Determine the correct URL based on platform
if sys.platform.startswith("linux"):
ADB_ZIP_URL = ADB_LINUX_ZIP_URL
elif sys.platform.startswith("win32"):
elif sys.platform.startswith("win"):
ADB_ZIP_URL = ADB_WIN_ZIP_URL
else:
return self.report_error("Unsupported platform")
print("Unsupported platform")
return False
self.check_local_disk_space()
check_local_disk_space()
print("Downloading platform-tools (ADB)...")
@@ -74,7 +80,7 @@ def check_device():
return line.split()[0]
return None
class App(tk.Tk):
class App(tk.Tk,):
def __init__(self):
super().__init__()
self.title("Android Folder Puller")